Skip to content

dev-achintha/Fileserver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java Network File Sharing Demo

This project demonstrates a simple Java application for network file sharing. It consists of two parts: a server and a client, each with its own graphical user interface (GUI).

How to Run

  1. Server:
    • Run the ServerGUI class.
    • Click the "Start" button to start the server.
    • The server will start listening on port 5002.
    • The "Connected Clients" label displays the number of currently connected clients.
    • Logs will be displayed in the text area.
  2. Client:
    • Run the ClientGUI class.
    • The client will attempt to connect to the server at localhost on port 5002.
    • The client GUI allows for file upload, download, and deletion. The log panel displays activities.

Note: Ensure that the server is running before starting any client.

Demo

To get a clear view, please click on the demo. 👇 ▪

a gif demostrating the work of the program

Project Structure

  • ClientGUI: This class handles the client's graphical user interface. It provides functionalities for uploading, downloading, and deleting files from the server.
  • ClientHandler: This class facilitates communication between the server and individual clients. It employs threads to concurrently handle multiple client connections. The class is responsible for processing messages received from clients and executing file-related operations.
  • JServer: This class represents the server. It manages client connections, handles file operations, and provides methods for starting and stopping the server.
  • ServerGUI: This class is the graphical user interface for the server. It allows the user to start and stop the server, view logs, and see the number of connected clients.
  • DatabaseHandler: This class manages the SQLite database used for storing file data.

Dependencies

This project uses Java's built-in libraries for socket programming, GUI, and file handling. And the sqlite-jdbc-3.43.0.0 driver to connect with database

Database

An SQLite database is used to store file data. The DatabaseHandler class handles database operations.

Usage

This project serves as a simple demonstration of how Java can be used in network programming for data sharing. It allows clients to upload, download, and delete files on the server.

Note

This project was created using Visual Studio Code with the Extension Pack for Java.
Make sure to have Java installed on your system.

Disclaimer: This project is a basic demonstration and may not be suitable for production use without further development and security considerations.

License

MIT License

Feel free to reach out if you have any questions or need further assistance. Happy coding!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages