Is there a way I can implement a secure FTP with org.apache.commons.net.ftp.FTPClient
?
If not, what are other options for Java?
Is there a way I can implement a secure FTP with org.apache.commons.net.ftp.FTPClient
?
If not, what are other options for Java?
Try Java Secure Channel
It supports SFTP
http://www.jcraft.com/jsch/
Example can be found here
How about trying Apache Camel,
http://camel.apache.org/ftp2.html
You can use org.apache.commons.net.ftp.FTPSClient instead of org.apache.commons.net.ftp.FTPClient to have secure ftp http://commons.apache.org/proper/commons-net/apidocs/org/apache/commons/net/ftp/FTPSClient.html
First, make sure you understand a difference between FTPS (Secure FTP) and SFTP:
FTPS versus SFTP versus SCP
If you need FTPS (aka Secure FTP or FTP over TLS/SSL), you can use
FTPSClient
instead ofFTPClient
from Apache Commons library:https://commons.apache.org/proper/commons-net/apidocs/org/apache/commons/net/ftp/FTPSClient.html
If you need SFTP (over SSH), see:
How to retrieve a file from a server via SFTP?
Java SFTP Transfer Library
Apache FTPClient doesn't support SFTP at the moment. However, you can use JSch - Java Secure Channel.
Onkar Joshi goes into more details of the library to use for FTP, SFTP, FTPS file transfer in Java.
An example of using JSch to transfer files with SFTP is as follows: