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).
-
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.
- Run the
-
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.
- Run the
Note: Ensure that the server is running before starting any client.
To get a clear view, please click on the demo. 👇 ▪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.
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
An SQLite database is used to store file data. The DatabaseHandler
class handles database operations.
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.
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.
Feel free to reach out if you have any questions or need further assistance. Happy coding!