The File Server
The File Server uses a Server Socket thread to continually listen for connections.
It uses Object streams to send and receive messages. Vectors are used to store
the messages. On receiving a message the server obtains the type of message from
the first string in the vector and the user from the second string.
The message types handled are 'Upload', 'List' and 'File'.
Message Types
Upload
On receiving an Upload message the server takes the file from
the third position in the received vector and copies it to the user's File
directory on the server. It sends a status message to the client indicating
success or failure.
List
On receiving a List message the server obtains the list of files from
the selected user's directory and stores this list in a vector.
It sends a status message to the client indicating success or failure. If
there are files available the list is sent to the requesting client.
File
On receiving a File message the server obtains the index of the requested file
in the requested user's directory.
It sends a message of type 'File' to the client.
It sends a status message to the client indicating success or failure. If
the file is available it is sent to the requesting client.