Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

AcusPGP/FileTransferProtocolProgram

Repository files navigation

File Transfer Protocol Program (Client & Server)


(追記)

USER GUIDE

(追記ここまで)

STEP 1: Before running the program, you make sure your computer already installed tools below

  • JDK version 18.0.2 or later
  • Maven version 4.0.0 or later
  • JFX version 18.0.2 or later

I recommend JDK and JFX version must be match 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).

STEP 2: Program is configured as follows

You can check and change the configuration in the config.properties file: src/main/resources/config.properties

Please make sure the values in the configuration is correct.

1. Server's configuration:

  • First value - port command (receiving client's command): 9000
  • Second value - port data (transferring data to client's storage): 9001
  • Third value - server IP address: your IP address or 127.0.0.1 (localhost)
  • Fourth value - directory path for 'file' folder: src/main/java/ftp/server/file

2. Client's configuration:

  • First value - port command (sending the client's command to server): 9000
  • Second value - port data (receiving data from server): 9001
  • 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

You can use this code to get the absolute path for your file.

For 'file' folder:

 File file=new File("src/main/java/ftp/server/file");
 String downloadPath=file.getAbsolutePath();

For 'download' folder:

 File file=new File("download");
 String filePath=file.getAbsolutePath();

STEP 3: Run the program

Click the file path below:

The Server need initiating first then you can run the Client or Application.


(追記)

OPERATING ILLUSTRATION PICTURES

(追記ここまで)
  1. 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.
  1. Server to Client (port data): one-way connection
  • Server bases on the command/action to transfer only the data to the client.

Simple picture:

Detail picture:


(追記)

JAVAFX GUI IMAGES

(追記ここまで)
  • Make sure the Server run first then initiate the Application.


(追記)

INSTALLING THIRD LIBRARY GUIDE

(追記ここまで)

Step 1:

  • Go to 'Preferences' then go to 'Plugins' and type 'lombok' to search. It will look like this

Step 2:

  • Enable Lombok then press Apply and OK

Step 3:

  • 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:

Step 4:

  • 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 Client {

Step 5:

  • It's done. Check the configuration again and run the program

About

A simple socket programming project.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

AltStyle によって変換されたページ (->オリジナル) /