Java org.apache.commons.net.ftp FTPClient fields, constructors, methods, implement or subclass

Example usage for Java org.apache.commons.net.ftp FTPClient fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for org.apache.commons.net.ftp FTPClient.

The text is from its open source code.

Subclass

org.apache.commons.net.ftp.FTPClient has subclasses.
Click this link to see all its subclasses.

Implementation

org.apache.commons.net.ftp.FTPClient has the following implementations.
Click this link to see all its implementation.

Field

intACTIVE_LOCAL_DATA_CONNECTION_MODE
A constant indicating the FTP session is expecting all transfers to occur between the client (local) and server and that the server should connect to the client's data port to initiate a data transfer.
intPASSIVE_LOCAL_DATA_CONNECTION_MODE
A constant indicating the FTP session is expecting all transfers to occur between the client (local) and server and that the server is in passive mode, requiring the client to connect to the server's data port to initiate a transfer.

Constructor

FTPClient()
Default FTPClient constructor.

Method

booleanabort()
Abort a transfer in progress.
voidaddProtocolCommandListener(ProtocolCommandListener listener)
Adds a ProtocolCommandListener.
booleanallocate(int bytes)
Reserve a number of bytes on the server for the next file transfer.
booleanappendFile(String remote, InputStream local)
Appends to a file on the server with the given name, taking input from the given InputStream.
OutputStreamappendFileStream(String remote)
Returns an OutputStream through which data can be written to append to a file on the server with the given name.
booleanchangeToParentDirectory()
Change to the parent directory of the current working directory.
booleanchangeWorkingDirectory(String pathname)
Change the current working directory of the FTP session.
booleancompletePendingCommand()
There are a few FTPClient methods that do not complete the entire sequence of FTP commands to complete a transaction.
voidconfigure(FTPClientConfig config)
Implementation of the Configurable Configurable interface.
voidconnect(InetAddress host)
Opens a Socket connected to a remote host at the current default port and originating from the current host at a system assigned port.
voidconnect(InetAddress host, int port)
Opens a Socket connected to a remote host at the specified port and originating from the current host at a system assigned port.
voidconnect(InetAddress host, int port, InetAddress localAddr, int localPort)
Opens a Socket connected to a remote host at the specified port and originating from the specified local address and port.
intcwd(String directory)
A convenience method to send the FTP CWD command to the server, receive the reply, and return the reply code.
intdele(String pathname)
A convenience method to send the FTP DELE command to the server, receive the reply, and return the reply code.
booleandeleteFile(String pathname)
Deletes a file on the FTP server.
voiddisconnect()
Closes the connection to the FTP server and restores connection parameters to the default values.
booleandoCommand(String command, String params)
Issue a command and wait for the reply.
voidenterLocalActiveMode()
Set the current data connection mode to ACTIVE_LOCAL_DATA_CONNECTION_MODE.
voidenterLocalPassiveMode()
Set the current data connection mode to PASSIVE_LOCAL_DATA_CONNECTION_MODE .
booleanenterRemoteActiveMode(InetAddress host, int port)
Set the current data connection mode to ACTIVE_REMOTE_DATA_CONNECTION .
booleanenterRemotePassiveMode()
Set the current data connection mode to PASSIVE_REMOTE_DATA_CONNECTION_MODE .
booleanfeatures()
Query the server for supported features.
StringfeatureValue(String feature)
Query the server for a supported feature, and returns the its value (if any).
String[]featureValues(String feature)
Query the server for a supported feature, and returns its values (if any).
booleangetAutodetectUTF8()
Tells if automatic server encoding detection is enabled or disabled.
intgetBufferSize()
Retrieve the current internal buffer size for buffered data streams.
intgetConnectTimeout()
Get the underlying socket connection timeout.
intgetDataConnectionMode()
Returns the current data connection mode (one of the _DATA_CONNECTION_MODE constants.
intgetDefaultPort()
Returns the current value of the default port (stored in #_defaultPort_ _defaultPort_ ).
booleangetListHiddenFiles()
StringgetModificationTime(String pathname)
Issue the FTP MDTM command (not supported by all servers to retrieve the last modification time of a file.
InetAddressgetRemoteAddress()
intgetReplyCode()
Returns the integer value of the reply code of the last FTP reply.
StringgetReplyString()
Returns the entire text of the last FTP server response exactly as it was received, including all end of line markers in NETASCII format.
String[]getReplyStrings()
Returns the lines of text from the last FTP server response as an array of strings, one entry per line.
StringgetStatus()
Issue the FTP STAT command to the server.
StringgetSystemName()
StringgetSystemType()
Fetches the system type from the server and returns the string.
booleanhasFeature(String feature)
Query the server for a supported feature.
FTPListParseEngineinitiateListParsing(String pathname)
Using the default autodetect mechanism, initialize an FTPListParseEngine object containing a raw file information for the supplied directory.
FTPListParseEngineinitiateListParsing(String parserKey, String pathname)
Using the supplied parser key, initialize an FTPListParseEngine object containing a raw file information for the supplied directory.
FTPListParseEngineinitiateListParsing(FTPFileEntryParser parser, String pathname)
private method through which all listFiles() and initiateListParsing methods pass once a parser is determined.
FTPListParseEngineinitiateListParsing()
Using the default autodetect mechanism, initialize an FTPListParseEngine object containing a raw file information for the current working directory on the server This information is obtained through the LIST command.
booleanisAvailable()
Make various checks on the socket to test if it is available for use.
booleanisConnected()
Returns true if the client is currently connected to a server.
booleanisRemoteVerificationEnabled()
Return whether or not verification of the remote host participating in data connections is enabled.
booleanisStrictMultilineParsing()
Return whether strict multiline parsing is enabled, as per RFC 959, section 4.2.
booleanisUseEPSVwithIPv4()
Whether should attempt to use EPSV with IPv4.
FTPFile[]listDirectories()
Using the default system autodetect mechanism, obtain a list of directories contained in the current working directory.
FTPFile[]listDirectories(String parent)
Using the default system autodetect mechanism, obtain a list of directories contained in the specified directory.
FTPFile[]listFiles()
Using the default system autodetect mechanism, obtain a list of file information for the current working directory.
FTPFile[]listFiles(String pathname)
Using the default system autodetect mechanism, obtain a list of file information for the current working directory or for just a single file.
FTPFile[]listFiles(String pathname, FTPFileFilter filter)
Version of #listFiles(String) which allows a filter to be provided.
String[]listNames()
Obtain a list of filenames in the current working directory This information is obtained through the NLST command.
String[]listNames(String pathname)
Obtain a list of filenames in a directory (or just the name of a given file, which is not particularly useful).
booleanlogin(String username, String password)
Login to the FTP server using the provided username and password.
booleanlogin(String username, String password, String account)
Login to the FTP server using the provided username, password, and account.
booleanlogout()
Logout of the FTP server by sending the QUIT command.
booleanmakeDirectory(String pathname)
Creates a new subdirectory on the FTP server in the current directory (if a relative pathname is given) or where specified (if an absolute pathname is given).
intmkd(String pathname)
A convenience method to send the FTP MKD command to the server, receive the reply, and return the reply code.
FTPFile[]mlistDir(String pathname)
Generate a directory listing using the MLSD command.
FTPFilemlistFile(String pathname)
Get file details using the MLST command
intnoop()
A convenience method to send the FTP NOOP command to the server, receive the reply, and return the reply code.
intpass(String password)
A convenience method to send the FTP PASS command to the server, receive the reply, and return the reply code.
intpasv()
A convenience method to send the FTP PASV command to the server, receive the reply, and return the reply code.
StringprintWorkingDirectory()
Returns the pathname of the current working directory.
intpwd()
A convenience method to send the FTP PWD command to the server, receive the reply, and return the reply code.
intquit()
A convenience method to send the FTP QUIT command to the server, receive the reply, and return the reply code.
booleanremoteRetrieve(String filename)
Initiate a server to server file transfer.
booleanremoveDirectory(String pathname)
Removes a directory on the FTP server (if empty).
voidremoveProtocolCommandListener(ProtocolCommandListener listener)
Removes a ProtocolCommandListener.
booleanrename(String from, String to)
Renames a remote file.
booleanretrieveFile(String remote, OutputStream local)
Retrieves a named file from the server and writes it to the given OutputStream.
InputStreamretrieveFileStream(String remote)
Returns an InputStream from which a named file from the server can be read.
intsendCommand(FTPCmd command)
Sends an FTP command to the server, waits for a reply and returns the numerical response code.
intsendCommand(String command, String args)
Sends an FTP command to the server, waits for a reply and returns the numerical response code.
booleansendNoOp()
Sends a NOOP command to the FTP server.
booleansendSiteCommand(String arguments)
Send a site specific command.
voidsetActiveExternalIPAddress(String ipAddress)
Set the external IP address in active mode.
voidsetActivePortRange(int minPort, int maxPort)
Set the client side port range in active mode.
voidsetAutodetectUTF8(boolean autodetect)
Enables or disables automatic server encoding detection (only UTF-8 supported).
voidsetBufferSize(int bufSize)
Set the internal buffer size for buffered data streams.
voidsetCharset(Charset charset)
Sets the charset.
voidsetConnectTimeout(int connectTimeout)
Sets the connection timeout in milliseconds, which will be passed to the Socket object's connect() method.
voidsetControlEncoding(String encoding)
Sets the character encoding used by the FTP control connection.
voidsetControlKeepAliveReplyTimeout(int timeout)
Set how long to wait for control keep-alive message replies.
voidsetControlKeepAliveTimeout(long controlIdle)
Set the time to wait between sending control connection keepalive messages when processing file upload or download.
voidsetCopyStreamListener(CopyStreamListener listener)
Set the listener to be used when performing store/retrieve operations.
voidsetDataTimeout(int timeout)
Sets the timeout in milliseconds to use when reading from the data connection.
voidsetDefaultPort(int port)
Sets the default port the SocketClient should connect to when a port is not specified.
voidsetDefaultTimeout(int timeout)
Set the default timeout in milliseconds to use when opening a socket.
booleansetFileStructure(int structure)
Sets the file structure.
booleansetFileTransferMode(int mode)
Sets the transfer mode.
booleansetFileType(int fileType)
Sets the file type to be transferred.
booleansetFileType(int fileType, int formatOrByteSize)
Sets the file type to be transferred and the format.
voidsetKeepAlive(boolean keepAlive)
Sets the SO_KEEPALIVE flag on the currently opened socket.
voidsetListHiddenFiles(boolean listHiddenFiles)
You can set this to true if you would like to get hidden files when #listFiles too.
booleansetModificationTime(String pathname, String timeval)
Issue the FTP MFMT command (not supported by all servers) which sets the last modified time of a file.
voidsetParserFactory(FTPFileEntryParserFactory parserFactory)
set the factory used for parser creation to the supplied factory object.
voidsetPassiveLocalIPAddress(String ipAddress)
Set the local IP address to use in passive mode.
voidsetPassiveLocalIPAddress(InetAddress inetAddress)
Set the local IP address to use in passive mode.
voidsetPassiveNatWorkaround(boolean enabled)
Enable or disable passive mode NAT workaround.
voidsetProxy(Proxy proxy)
Sets the proxy for use with all the connections.
voidsetReceieveDataSocketBufferSize(int bufSize)
Sets the value to be used for the data socket SO_RCVBUF option.
voidsetReceiveBufferSize(int size)
Sets the underlying socket receive buffer size.
voidsetRemoteVerificationEnabled(boolean enable)
Enable or disable verification that the remote host taking part of a data connection is the same as the host to which the control connection is attached.
voidsetReportActiveExternalIPAddress(String ipAddress)
Set the external IP address to report in EPRT/PORT commands in active mode.
voidsetRestartOffset(long offset)
Sets the restart offset for file transfers.
voidsetSendBufferSize(int size)
Set the underlying socket send buffer size.
voidsetSendDataSocketBufferSize(int bufSize)
Sets the value to be used for the data socket SO_SNDBUF option.
voidsetSocketFactory(SocketFactory factory)
Sets the SocketFactory used by the SocketClient to open socket connections.
voidsetSoTimeout(int timeout)
Set the timeout in milliseconds of a currently open connection.
voidsetStrictMultilineParsing(boolean strictMultilineParsing)
Set strict multiline parsing.
voidsetTcpNoDelay(boolean on)
Enables or disables the Nagle's algorithm (TCP_NODELAY) on the currently opened socket.
voidsetUseEPSVwithIPv4(boolean selected)
Set whether to use EPSV with IPv4.
intsite(String parameters)
A convenience method to send the FTP SITE command to the server, receive the reply, and return the reply code.
booleanstoreFile(String remote, InputStream local)
Stores a file on the server using the given name and taking input from the given InputStream.
OutputStreamstoreFileStream(String remote)
Returns an OutputStream through which data can be written to store a file on the server using the given name.
booleanstoreUniqueFile(String remote, InputStream local)
Stores a file on the server using a unique name derived from the given name and taking input from the given InputStream.
intuser(String username)
A convenience method to send the FTP USER command to the server, receive the reply, and return the reply code.