Skip to content

A multithreaded client-server program that uses Java Sockets to establish TCP/IP connection. The server allows multiple clients to upload, retrieve and delete files on/from the server.

License

Lokesh-Bisht/FileServer

Repository files navigation

Welcome to FileServer👨‍💻 👋

FileServer is a multithreaded client-server program that uses TCP/IP connection for establshing a connection between a client and the server. It allows multiple clients to connect to and interact with the server simulataneously. The fileServer is a file storage program that allows the client to upload, fetch and delete files on/from the server. The file can be of any type text, image, video, audio, dmg, etc.

Table of contents

  1. Getting Started
  2. Demo
  3. Installation
  4. License
  5. Author

Getting started

The Server

FileServer consist of a multithreaded server that listens for incoming clients on the main thread and processes the client request on a separate pool of threads. This helps the server from not being occupied by the processing of the long running client request. And server will always be available for listening to new client request. Once the server process the client request, the server will generate a response and send it to the client.

and handles each client request on a separate thread.

The Client

The client sends a request to the server. And waits for the server response. After the server sends back a response the client displays an approriate message realated to the response to the user.

The client can send the different types of request to the server, which are as following:

  1. The client can send a request to upload a file on the servre.
  2. Client can also fetch a file from the server.
  3. Delete a file from the server.
  4. Client can also close its connection to the server.
  5. It can also send a request to shutdown server (In real world scenarios we don't do this :P)

✨Demo

Uploading files on the server

Upload.files.mov



Retrieving files from the server

Retrieve.mov



Deleting files from the server

Delete.mov



Invalid Client Request: For example retrieving/deleting (by file name or file ID) a file from the server that does not exist on the server. Or uploading a file on the server that does not exist on the client machine.

InvalidRequest.mov



Other user actions:

  1. Invalid user action
  2. Closing the client
  3. Shutting down the server
Exit.mov



Installation

From IDE:

  1. Download the project.
  2. Unzip it.
  3. Import the project to an IDE like IntelliJ IDEA, Microsoft Visual Studio or Eclipse.
  4. Build the project.
  5. Run the main file inside server folder to start the server.
  6. Run the main file inside client folder to start the client.
  7. You can also allow multiple instances of the client program to run.

From terminal:

  1. Open the project directory on terminal/command prompt.
  2. Move to the server folder and use the javac Main.java command to compile the server program.
  3. Move to the client folder and use the javac Main.java command to compile the client program.
  4. Use the java Main command to start the server.
  5. Use the java Main command to start the client.

Note: You need to have Java on your system to run this project.


License

Read more about the license here:
Apache License 2.0


Author

Lokesh Bisht

About

A multithreaded client-server program that uses Java Sockets to establish TCP/IP connection. The server allows multiple clients to upload, retrieve and delete files on/from the server.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages