Java to achieve SFTP Client upload files and folders function code
•
Java
1. Dependent jar file jsch-0.1 53.jar
2. Login methods include password login and key login
code:
Main function:
Login page code:
File upload code:
Code to read configuration file:
Code directory structure:
The test run-time configuration file is placed in the bin directory of the project (it should be deleted when packaged into a runnable jar file. After packaging, the configuration file and jar package can be placed in the same level directory):
properties. properties
Package the runnable jar file:
Export->java->Runnabe JAR file
After completion
Run Java - jar on the console to export the name of the jar package Jar
The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码