[1318] in java-interest
Re: Multiple user access to a file on a remote server
daemon@ATHENA.MIT.EDU (Chuck McManis)
Tue Aug 29 21:54:11 1995
Date: Tue, 29 Aug 1995 16:04:16 -0700
From: cmcmanis@scndprsn.Eng.Sun.COM (Chuck McManis)
To: mikea@ai.mit.edu
Cc: java-interest@java.Eng.Sun.COM
> I would like to have an applet that will be dependant on a text file
>on a remote host. This applet should be accessable through a simple
>URL, but I would like to enable it to have read/write permissions to a
>text file on a remote host (the host serving the applet to the local
>hotjava browser).
> First of all is this possible?
Certainly it is possible, the security implications however are that the
remote text file should be on the same host as the one the applet originated
from (to prevent third party distribution of information) and the applet
is constrained from opening any files or talking to any internal servers.
What is required on the part of HotJava is that an applet not be able to
get information from inside your firewall and export it to a server
"outside."
A better way to design it is to have a separate protocol to talk back to
the server which is running a daemon that can locate and access the
file on behalf of the applet.
> Secondly, the API on files is rather
> hazy, how does one go about manipulating a file in java?
To read one sequentially open a FileInputStream() and invoke read(). To write
one sequentially use a FileOutputStream(). To access one "randomly" you can
use the RandomAccessFile class.
> Thirdly, is
>there a better way to manage multiple instances of the same applet
>that mutually effect eachother?
Can't answer that without more information about what the requirements are.
--Chuck
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com