What is it?

JFS is a simple, TCP/IP based network filesystem protocol. It allows applets running in a web browser to load and save files on a remote server, as well as send email and print documents through the JFS server. Because Java applets cannot access the filesystem of the machine they are running on, this provides a useful way for applets to store state information.

The JFS clients, server and source code are free for non-commercial use, such as student projects and personal experimentation. However, if you want to use the code in a commercial project, email me.


How does it work?

A JFS server is run on a unix system along with a web server. When a JFS-capable applet is downloaded from the web server, it establishes a connection with the JFS server and sends a username and password. From then on, the applet sends requests to the JFS server to do things like :

All the files accessed through the JFS server are stored on the server host in files and directories beneath the server's root directory. The server maintains a list of users and groups for the filesystem, and a set of permissions for each JFS file. These users and permissions are totally separate from the actual unix files and permissions on the server host.

Once a client program has connected to the server, all communication between client and server is in the form of requests and replys. Each request from the client will cause the server to send back one reply. For example, to load a file from the JFS filesystem the client would send a Get request. In response, the server would send either a Fail or Data reply, depending on the success or failure of the request.


Downloading the JFS server

The source and binaries for the JFS server and clients are available from the URLs below (note - you may have to shift-click on the links to get your browser to save the files)

http://www.webmin.com/jfs/jfs-0.05.tar.Z

http://www.webmin.com/jfs/jfs-0.05.tar.gz

http://www.webmin.com/jfs/jfs-0.05.zip

To use the server, unpack the tar file into some web-accessible directory on a machine running a web server. In the newly created directory, type java JFSserver ./root to start up the JFS server using the example server root directory supplied. You should then be able to use Netscape or Appletviewer to access the web page index.html in the new directory, which has links to some JFS applets included in the distribution.


Writing JFS clients

Java programs that want to load and save files on a JFS server should use the JFSclient class, which has methods for all the requests a client needs to make. If you want to write a Java class that can be invoked by the File Browser to handle files of some mime type, your class must inherit from the JFScomponent class. For more information about these classes, see