Class FileManagerServlet

FileManagerServlet

public class FileManagerServlet

This class handles all File communications with the Client. This class handles logging in and out, as well as requests to retrieve and save files, and other file manipulations on the server. It does not directly manipulate files, but instead passes most requests on to the AccountFileManager. The communication protocol is made up of querystrings passed by the Client to this Servlet in the URL. All protocols are send from the Client using the FORM POST method, and files are passed in the body of the FORM. The constants that make up the communication protocol are found in the org.bioquery.bqutils.BQProtocol class.

The protocols used involve placing standard name-value pairs in the URL. This Servlet tracks the user session, so the first parameter is the session id. The next parameter is the method, which tells this Servlet which operation to run. For example:
&BQProtocol.FILE_METHOD=BQProtocol.MOVE_FILE
If additional parameters are needed they can be added after the method parameter. For example:
&BQProtocol.FILE_PATH=/username/myresults/myfile.html&BQProtocol.NEW_FILE=/username/myotherresults/myfile.html

Author:
James Brundege

Constructor Summary
FileManagerServlet()
           
 
Method Summary
 void doGet(HttpServletRequest request, HttpServletResponse response)
          doGet method for testing purposes only.
 void doPost(HttpServletRequest request, HttpServletResponse response)
          This method handles all communication requests from the Client, which must be as POST requests.
 void init()
          Loads the BioQuery users directory parameter from the web.xml file.
 

Constructor Detail

FileManagerServlet

public FileManagerServlet()
Method Detail

init

public void init()
          throws ServletException
Loads the BioQuery users directory parameter from the web.xml file.

doGet

public void doGet(HttpServletRequest request,
                  HttpServletResponse response)
           throws ServletException,
                  java.io.IOException
doGet method for testing purposes only. Not used by the program.

doPost

public void doPost(HttpServletRequest request,
                   HttpServletResponse response)
            throws ServletException,
                   java.io.IOException
This method handles all communication requests from the Client, which must be as POST requests. It uses the METHOD parameter in the URL querystring to determine which method the client is requested, and carries out that request. This method can thus handle the following methods:

      login
      logout
      create new account
      update file list
      open file
      create directory
      save file
      delete file
      move file
      copy file
      rename file
      send feedback