Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Secure FTP with org.apache.commons.net.ftp.FTPClient

Tags:

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?

like image 718
user1725253 Avatar asked Oct 09 '12 15:10

user1725253


People also ask

How do I import org Apache Commons Net FTPClient FTP?

Here's the official Apache download site for Commons Net. Once you've picked and extracted the appropriate version, set a dependency in your Eclipse project: Right-click the project and choose "Properties" Choose "Java Build Path" from the resulting popup.

Does Apache FTPClient support SFTP?

Apache FTPClient doesn't support SFTP at the moment.

What is FTPClient in Java?

FTPClient encapsulates all the functionality necessary to store and retrieve files from an FTP server. This class takes care of all low level details of interacting with an FTP server and provides a convenient higher level interface.

Which of the following is an example of secure FTPClient?

SolarWinds Solar-PuTTY is our top pick for an FTP and SFTP client for Windows and Linux because it is the product of a leading system monitoring and management tool provider but it is completely free to use.

What is Apache Commons Net FTP?

The methods of this class as other classes of Apache Commons Net FTP are wrappers for FTP manipulation, so the code which implemented those methods becomes significantly smaller, cleaner and understandable comparing to other programs where those functionalities are written manually. 1. A Closer Look to the org.apache.commons.net.ftp Package

What is the use of public class ftpclient?

Class FTPClient. public class FTPClient extends FTP implements Configurable FTPClient encapsulates all the functionality necessary to store and retrieve files from an FTP server. This class takes care of all low level details of interacting with an FTP server and provides a convenient higher level interface.

What is an ftpconnectionclosedexception?

The FTPClient class will detect a premature FTP server connection closing when it receives a FTPReply.SERVICE_NOT_AVAILABLE response to a command. When that occurs, the FTP class method encountering that reply will throw an FTPConnectionClosedException .

What are the FTP command methods in ftpclient?

The convention for all the FTP command methods in FTPClient is such that they either return a boolean value or some other value. The boolean methods return true on a successful completion reply from the FTP server and false on a reply resulting in an error condition or failure.


1 Answers

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 class from Apache Commons library instead of FTPClient.

  • If you need SFTP (over SSH), you need a different library. See:
    How to retrieve a file from a server via SFTP? or
    Java SFTP Transfer Library.

like image 160
Martin Prikryl Avatar answered Sep 28 '22 08:09

Martin Prikryl