Skip to content

A simple file sharing system (FSS) using a command line interface. The FSS consists of two types of entities: a file server and many clients.

Notifications You must be signed in to change notification settings

alanjb/file-sharing-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

File Sharing System using Java Sockets

Alan Boyce, SWE622, Programming Assignment 1
Deliverables
  • Executable and self-contained jar file.
  • A read-me text file.
  • Source Code in Java.

Installation

Open a terminal window and run the following command to create a 'server' directory and change directories into it.

mkdir –p server && cd server

Add the pa1.jar file into the server directory.

In the terminal window executing in the server directory, run the following command to start the server.

java -cp pa1.jar server start 8000

Change directories out of the server and create a new 'client1' directory.

cd .. && mkdir -p client1 && cd client1

Run the following command so clients know how to contact the server.

export PA1_SERVER=localhost:8000

For Windows machines, run this command instead.

set PA1_SERVER=localhost:8000

Add the pa1.jar file into the client directory.

Files sent to or retrieved from the server will be stored/accessed in the server's / (root) directory. If a user specifies a subfolder within the root directory, the file will be stored/accessed within it.

Executable jar file is located /pa1/out/artifacts/pa1_jar/pa1.jar.

Client Commands

Run the following commands within a client directory.

Upload

java -cp pa1.jar client upload <path_on_client> </path/filename/on/server>

Download

java -cp pa1.jar client download </path/existing_filename/on/server> <path_on_client>

List directory items

java -cp pa1.jar client dir </path/existing_directory/on/server>

Create a directory

java -cp pa1.jar client mkdir </path/new_directory/on/server>

Remove a directory

java -cp pa1.jar client rmdir </path/existing_directory/on/server>

Remove a file

java -cp pa1.jar client rm </path/existing_filename/on/server>

Shutdown server

java -cp pa1.jar client shutdown

About

A simple file sharing system (FSS) using a command line interface. The FSS consists of two types of entities: a file server and many clients.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published