0

I have been working on a project, in which I have to send files from local system to my FTP-server. for this purpose I thought of using Apache MINA.

is Apache MINA can be implemented in this situation, any suggestion or help will be useful. thanks.

MAHI
  • 9,263
  • 11
  • 36
  • 47

2 Answers2

1

I know Apache Commons Net is a convenient and efficient library for writing FTP clients.

They also provide a FTP client example: FTPClientExample.java

Jean Logeart
  • 52,687
  • 11
  • 83
  • 118
1

Yes you can use Apache Mina for this purpose. Look for following JARs/References

mina-core-2.0.19.jar - For authentication purpose
slf4j-api-1.7.25.jar - For logging purpose
sshd-common-2.1.0.jar - Common functions dependent jars
sshd-core-2.1.0.jar - Common functions dependent jars
sshd-sftp-2.1.0.jar - For SFTP file transfers and creating 

clients and connections

Some example:

mSshClient = SshClient.setUpDefaultClient();
 mSshClient.start();
 mConnectFuture = mSshClient.connect(mUsername,mServerAddress.getHostAddress(),mServerPort,null);
 mClientSession = mConnectFuture.verify().getSession();
 mSftpClient = new DefaultSftpClient(mClientSession);
Rajeev Joshi
  • 21
  • 1
  • 3