Jamie Cameron / jcameron@letterbox.com


Introduction

JFS is a simple network filesytem protocol for java applets. Because applets cannot access the local storage of the machine they are running on, any applet that wants to load or save files needs some mechanism for accessing files on the web server from which the applet was loaded. JFS provides one way for applets to do this.

The JFS server is a java program that is run on the same host as a web server. JFS clients are java applets that conect back to the server on the host from which they were loaded via a TCP connection. Once the connection has been established and the client has authenticated itself, the client can make requests to do things like loading and saving files, creating directories and getting user information.


Starting the server

Included with this distribution is the source code and compiled .class files for the JFS server, which is written in Java. At the moment the server will only run on Unix systems, as it calls /bin/rmdir and /bin/ln to delete directories and to make symbolic links (which cannot yet be done in any portable way).

The JFS server should ideally be run on a host that is also running a web server, with the .class files from the distribution in some web accessible directory. JFS client applets can then be loaded from the web server, and connect back to the JFS server to load & save files. However you can run the JFS server on a machine without a web server if you like, and access all the client applets through file: URLs.

The JFS server uses a directory in the local filesystem of the machine on which it is run as the root directory for the JFS filesytem. Ownership and access rights for files in this 'virtual filesystem' are stored in a file called .jfs in each directory. The directory root in this distribution contains the basic files needed by the JFS filesystem, such as /etc/users and the /dev directory.

To start the JFS server on your machine, cd to the distribution directory and type:

java JFSserver ./root -

This will start the server on the directory root, with server log information written to the standard output. To have the server write log information to a file, replace the - above with a filename to append to. If no filename is given, logging information is written to the file server_log in the current directory.


Running JFS clients

Once you have a JFS server running, you can use a Java aware web browser such as Netscape 2 or Appletviewer to run the JFS client applets included in this distribution. When run, the applet will connect back to the JFS server on the host from which it was loaded (or the localhost if you are using a file: URL). The client applets included in this distribution are:

The applets on the web pages above will automatically log in to the JFS server as the user root (specified by parameters in the <applet> tag).


Technical details

For more details on writing JFS clients, see the JFS web page, the JFSclient docs, and the JFScomponent docs.

Practical uses

Any applet that needs to write state information back to the server from which it was loaded can make use of JFS. Also, applets wanting to get data from arbitarary URLs or make connections to arbitrary hosts can use the JFS devices /dev/Web and /dev/TCP.

One quite useful application of JFS is the creation of web pages entirely through the web. If the server root directory is somewhere web-accessible, JFS users can create HTML and text files using the text editor applet without having to leave their web browser. See http://www.focus-asia.com/ for an example of this.


To do...


Bugs and problems