Snapster
B

efore running the Snapster client, the Snapster server must be started. The Snapster server uses the Java RMI (Remote Method Invocation) architecture. So, the rmiregistry must be started first, after the rmiregistry has been started on specific port then we run the server on the same port. For instance:

        rmiregistry 2001
        java SnapsterServer 2001

Now that the Snapster server is up and running we can start the client. The client is an Applet and hence it is accessed through a webpage or by using a web browser (IE 3.0+ or Netscape 4.0+). The client requires special privileges that are not normally given to unsigned Applets, but are given to signed Applets. So, I signed the applet with a test certificate and imported the test certificate into the Java Runtime's trusted certificate store. (If I wanted to deploy Snapster, I would have the Applet signed by a trusted root authority like Verisign whose certificate is already in the certificate store).
Ok, the first time we run the Applet it looks for the Java Plug-in. If the plug-in is not found, it is automatically installed. After the plug-in has been installed, the Applet is loaded and the user is asked to grant permissions to the Applet. So far I have only tested the Applet on Windows 98 and it runs beautifully. Once the user has granted the Applet permissions it is off and running.
First the applet looks for the settings files in a directory named "Snapster" that it creates in the user's home directory. If they exists, the client loads the stored settings. Otherwise, it uses the default settings. A server is not specified by default. In fact, I only included the server settings for testing purposes (because the server is continuously changing addresses). Since a server is not specified by default, the first screen we see is the server settings screen.
After entering the server name and port number and clicking ok, the server is contacted and the user is prompted to create a new user account.
A user account is simply a user ID and password. The user ID must be unique because the server uses it to manage the shared files lists.
If the user ID is already taken, the user is prompted to choose a different user ID.
If the user already has an account but the settings file was accidentally deleted, the user can check the "I have an account" check box and login without creating a new account.
After the user account is created, the user is prompted to login.
If the user would like their password to be saved so they do not have to re-enter it in the future, they can check the "Save password" check box.
Now we are getting to the more interesting stuff. The user may wish to change some settings before continuing to login. The settings can be accessed through the "Smenu".
These are the default settings on a Windows 98 machine. However, I have not implemented the mechanism to support the Maximum Simultaneous Downloads or Uploads settings yet.
Lets go ahead and change our Shared Directory to the C directory so we will be sharing every file on the C drive and lets change our connection speed to ISDN. (it doesn't matter if you put a backslash in or not)
We click Ok and we are back at the login screen.
When we click "Login" the Applet contacts the server and sends the users shared file descriptors along with some other information . If the login is successful, the screen changes to the search screen.
Now, all we have left to do is search to our hearts content.
Or, we can leave the period out. This time we got more results. Notice that scrollbars appear when the window become too full.
Before we download anything lets sort the search results. Suppose we are looking for a big file. Lets sort the results by file size in descending order (it is ascending by default). From now on the search results will automatically be sorted by file size (unless we specifically say not to sort). Check it out. We can right-click anywhere in the search results window to pull up the sort menu.
We actually have to pull up the menu again and choose descending.
Ah, there are the files I was looking for. . . Now all we have to do to start downloading is double click on the files we want to download.
Each client can download and upload multiple files at a time. To see which files you are downloading simply click on the "Downloads" tab at the top of the tabbed window pane.
After we have downloaded the files, the client updates our shared file descriptors on the server so that others may download them from us.
Notice the meters that allow us to watch the progress of the file transfers. Each block represents 10% of the total file size. Now if we don't want to search for anything else we can logout by going to the Smenu. Alternatively we can simply close the browser and we will be logged out automatically. Once we log out, other users will no longer see our files.
I have glossed over some of the smaller features that make this a usable system. For instance we don't have to hit the search button to search, we can simply press the enter key. Also, the window is resizable. So, if you don't want to take up a whole lot of space, just resize it. If you are interested in getting a more in depth look at the mechanisms that make Snapster, they are outlined in the Project Report.

If you have any further questions please do not hesitate to contact me at chad@chadlangston.com.

Thank you for reading. I hope you enjoyed it. -Chad