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.
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.
The organisation of the local files and directories under the JFS server root closely follows the layout of files and directories in the JFS filesystem. Each directory in the JFS filesystem has a corresponding local directory of the same name, and each single-version JFS file is stored in one local file of the same name. Multi-version files, however, use one local file for each version of the JFS file, named the same as the file but with a comma and the version number at the end. So version 2 of the file foobar would be stored as foobar,2. A soft-link always points from local file with the same name as the JFS file to the local file for the highest-numbered version.
Messages from client to server are called Requests, and messages from server to client Replys. Whenever a client program wants to load a file, authenticate itself or anything else a request is sent to the server, which responds with a reply indicating the success or failure of the request (and possibly containing some data). For example, to load a file a client might send :
Request: Get
File: /tmp/foo
To which the server would reply :
Reply: Data
Content-length: 12
hello world
The first request a client must send after connecting to a server is the Auth request, which contains a username and password. This authorises the client, so the server knows which files and directories it has access to.
This means that any JFScomponent-derived object can be instantiated in an applet (as in the applets linked to above), or in a new top-level window (as the File Browser applet does when a filename is double-clicked on). Because Java allows loading of classes by name at runtime, a JFS client like the File Browser can use a mapping between MIME types and JFScomponent-derived classes to load a handler class to display a file.
Devices provide a (relatively) nice way for JFS clients to do things like printing or sending email through the server. The following device drivers are included in this distribution:
A property may only be read or written by its owner (or root). Any client program can create, retreive or delete properties belonging to the user the client is connected as, using the Setprop, Getprop and Delprop requests.
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.