- This is a program of presenting a menu of server's services based on client's command.
- Project link (GitHub) : https://github.com/phamgiaphuc/DownloadMultipleFiles
- Project's author: Pham Gia Phuc - Acus
- Personal profile: https://github.com/phamgiaphuc
- Contact Email: acuscodinghcm@gmail.com
- Java.
- Socket Programming and File Transfer Protocol.
- Maven.
- Lombok library.
- JDK version 18.0.2 or later.
- JFX version 18.0.2 or later.
- Maven version 4.0.0 or later.
I recommend JDK, JFX and Maven version must be match (the same as above versions) in order to have full experience to run the program successfully.
- Check the pom.xml file if the third library "Lombok" is installed in the file
If the library is not installed, check the "Install third library guide" section.
You can check and change the configuration in the config.properties file: src/main/resources/configuration/config.properties
Please make sure the values in the configuration is correct.
1. Server's configuration:
- First value - port command (receiving client's command): 6000
- Second value - port file (transferring data or downloading files to client's storage): 6001
- Third value - server IP address: your IP address or 127.0.0.1 (localhost)
- Fourth value - directory path for 'file' folder: src/main/java/server/file
2. Client's configuration:
- First value - port command (sending the client's command to server): 6000
- Second value - port file (receiving data or downloading files from server): 6001
- Third value - server IP address: your IP address or 127.0.0.1 (localhost)
- Fourth value - directory path for 'download' folder - all the download files will be stored in here: download
Click the file path below:
The Server need initiating first then you can run the Client or Application.
- To run Server, go to: src/main/java/server/connection/ServerConfiguration.java
- To run Client, go to: src/main/java/client/connection/ClientConfiguration.java
java
|__ client #client operation
|__ connection
|__ operation
|__ utilities
|__ server #server operation
|__ connection
|__ operation
|__ file
|__ utilities
resources
|__ configuration #system and library configuration
- Client to Server (port command): two-way connection.
- Client
send the command
to the server. - Server
reply by sending a menu of services based on the command
for client to choose next command/action.
- Server to Client (port file): one-way connection.
- Server bases on the command/action to
transfer only the data or downloading files
to the client.
Advice: Please follow the steps below otherwise the program can not run.
- Go to 'Preferences' then go to 'Plugins' and type 'lombok' to search. It will look like this
- Enable Lombok then press Apply and OK.
- Go to the pom.xml file and add this code like in the picture.
code:
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.24</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>2.0.0</version>
<scope>runtime</scope>
</dependency>
picture:
Notice: Remember to clean, compile and reload the file again.
- Everytime you want to use the third library, just enter "@Slf4j" on the head of the class like this.
package ftp.client;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class ClientConnection {
// Variables...
}
- It's done. Check the configuration again and run the program.