Example usage for Java org.apache.commons.net.ftp FTPClient fields, constructors, methods, implement or subclass
The text is from its open source code.
int | ACTIVE_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. |
int | PASSIVE_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. |
FTPClient() Default FTPClient constructor. |
boolean | abort() Abort a transfer in progress. |
void | addProtocolCommandListener(ProtocolCommandListener listener) Adds a ProtocolCommandListener. |
boolean | allocate(int bytes) Reserve a number of bytes on the server for the next file transfer. |
boolean | appendFile(String remote, InputStream local) Appends to a file on the server with the given name, taking input from the given InputStream. |
OutputStream | appendFileStream(String remote) Returns an OutputStream through which data can be written to append to a file on the server with the given name. |
boolean | changeToParentDirectory() Change to the parent directory of the current working directory. |
boolean | changeWorkingDirectory(String pathname) Change the current working directory of the FTP session. |
boolean | completePendingCommand() There are a few FTPClient methods that do not complete the entire sequence of FTP commands to complete a transaction. |
void | configure(FTPClientConfig config) Implementation of the Configurable Configurable interface. |
void | connect(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. |
void | connect(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. |
void | connect(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. |
int | cwd(String directory) A convenience method to send the FTP CWD command to the server, receive the reply, and return the reply code. |
int | dele(String pathname) A convenience method to send the FTP DELE command to the server, receive the reply, and return the reply code. |
boolean | deleteFile(String pathname) Deletes a file on the FTP server. |
void | disconnect() Closes the connection to the FTP server and restores connection parameters to the default values. |
boolean | doCommand(String command, String params) Issue a command and wait for the reply. |
void | enterLocalActiveMode() Set the current data connection mode to ACTIVE_LOCAL_DATA_CONNECTION_MODE . |
void | enterLocalPassiveMode() Set the current data connection mode to PASSIVE_LOCAL_DATA_CONNECTION_MODE . |
boolean | enterRemoteActiveMode(InetAddress host, int port) Set the current data connection mode to ACTIVE_REMOTE_DATA_CONNECTION . |
boolean | enterRemotePassiveMode() Set the current data connection mode to PASSIVE_REMOTE_DATA_CONNECTION_MODE . |
boolean | features() Query the server for supported features. |
String | featureValue(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). |
boolean | getAutodetectUTF8() Tells if automatic server encoding detection is enabled or disabled. |
int | getBufferSize() Retrieve the current internal buffer size for buffered data streams. |
int | getConnectTimeout() Get the underlying socket connection timeout. |
int | getDataConnectionMode() Returns the current data connection mode (one of the _DATA_CONNECTION_MODE constants. |
int | getDefaultPort() Returns the current value of the default port (stored in #_defaultPort_ _defaultPort_ ). |
boolean | getListHiddenFiles() |
String | getModificationTime(String pathname) Issue the FTP MDTM command (not supported by all servers to retrieve the last modification time of a file. |
InetAddress | getRemoteAddress() |
int | getReplyCode() Returns the integer value of the reply code of the last FTP reply. |
String | getReplyString() 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. |
String | getStatus() Issue the FTP STAT command to the server. |
String | getSystemName() |
String | getSystemType() Fetches the system type from the server and returns the string. |
boolean | hasFeature(String feature) Query the server for a supported feature. |
FTPListParseEngine | initiateListParsing(String pathname) Using the default autodetect mechanism, initialize an FTPListParseEngine object containing a raw file information for the supplied directory. |
FTPListParseEngine | initiateListParsing(String parserKey, String pathname) Using the supplied parser key, initialize an FTPListParseEngine object containing a raw file information for the supplied directory. |
FTPListParseEngine | initiateListParsing(FTPFileEntryParser parser, String pathname) private method through which all listFiles() and initiateListParsing methods pass once a parser is determined. |
FTPListParseEngine | initiateListParsing() 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. |
boolean | isAvailable() Make various checks on the socket to test if it is available for use. |
boolean | isConnected() Returns true if the client is currently connected to a server. |
boolean | isRemoteVerificationEnabled() Return whether or not verification of the remote host participating in data connections is enabled. |
boolean | isStrictMultilineParsing() Return whether strict multiline parsing is enabled, as per RFC 959, section 4.2. |
boolean | isUseEPSVwithIPv4() 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). |
boolean | login(String username, String password) Login to the FTP server using the provided username and password. |
boolean | login(String username, String password, String account) Login to the FTP server using the provided username, password, and account. |
boolean | logout() Logout of the FTP server by sending the QUIT command. |
boolean | makeDirectory(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). |
int | mkd(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. |
FTPFile | mlistFile(String pathname) Get file details using the MLST command |
int | noop() A convenience method to send the FTP NOOP command to the server, receive the reply, and return the reply code. |
int | pass(String password) A convenience method to send the FTP PASS command to the server, receive the reply, and return the reply code. |
int | pasv() A convenience method to send the FTP PASV command to the server, receive the reply, and return the reply code. |
String | printWorkingDirectory() Returns the pathname of the current working directory. |
int | pwd() A convenience method to send the FTP PWD command to the server, receive the reply, and return the reply code. |
int | quit() A convenience method to send the FTP QUIT command to the server, receive the reply, and return the reply code. |
boolean | remoteRetrieve(String filename) Initiate a server to server file transfer. |
boolean | removeDirectory(String pathname) Removes a directory on the FTP server (if empty). |
void | removeProtocolCommandListener(ProtocolCommandListener listener) Removes a ProtocolCommandListener. |
boolean | rename(String from, String to) Renames a remote file. |
boolean | retrieveFile(String remote, OutputStream local) Retrieves a named file from the server and writes it to the given OutputStream. |
InputStream | retrieveFileStream(String remote) Returns an InputStream from which a named file from the server can be read. |
int | sendCommand(FTPCmd command) Sends an FTP command to the server, waits for a reply and returns the numerical response code. |
int | sendCommand(String command, String args) Sends an FTP command to the server, waits for a reply and returns the numerical response code. |
boolean | sendNoOp() Sends a NOOP command to the FTP server. |
boolean | sendSiteCommand(String arguments) Send a site specific command. |
void | setActiveExternalIPAddress(String ipAddress) Set the external IP address in active mode. |
void | setActivePortRange(int minPort, int maxPort) Set the client side port range in active mode. |
void | setAutodetectUTF8(boolean autodetect) Enables or disables automatic server encoding detection (only UTF-8 supported). |
void | setBufferSize(int bufSize) Set the internal buffer size for buffered data streams. |
void | setCharset(Charset charset) Sets the charset. |
void | setConnectTimeout(int connectTimeout) Sets the connection timeout in milliseconds, which will be passed to the Socket object's connect() method. |
void | setControlEncoding(String encoding) Sets the character encoding used by the FTP control connection. |
void | setControlKeepAliveReplyTimeout(int timeout) Set how long to wait for control keep-alive message replies. |
void | setControlKeepAliveTimeout(long controlIdle) Set the time to wait between sending control connection keepalive messages when processing file upload or download. |
void | setCopyStreamListener(CopyStreamListener listener) Set the listener to be used when performing store/retrieve operations. |
void | setDataTimeout(int timeout) Sets the timeout in milliseconds to use when reading from the data connection. |
void | setDefaultPort(int port) Sets the default port the SocketClient should connect to when a port is not specified. |
void | setDefaultTimeout(int timeout) Set the default timeout in milliseconds to use when opening a socket. |
boolean | setFileStructure(int structure) Sets the file structure. |
boolean | setFileTransferMode(int mode) Sets the transfer mode. |
boolean | setFileType(int fileType) Sets the file type to be transferred. |
boolean | setFileType(int fileType, int formatOrByteSize) Sets the file type to be transferred and the format. |
void | setKeepAlive(boolean keepAlive) Sets the SO_KEEPALIVE flag on the currently opened socket. |
void | setListHiddenFiles(boolean listHiddenFiles) You can set this to true if you would like to get hidden files when #listFiles too. |
boolean | setModificationTime(String pathname, String timeval) Issue the FTP MFMT command (not supported by all servers) which sets the last modified time of a file. |
void | setParserFactory(FTPFileEntryParserFactory parserFactory) set the factory used for parser creation to the supplied factory object. |
void | setPassiveLocalIPAddress(String ipAddress) Set the local IP address to use in passive mode. |
void | setPassiveLocalIPAddress(InetAddress inetAddress) Set the local IP address to use in passive mode. |
void | setPassiveNatWorkaround(boolean enabled) Enable or disable passive mode NAT workaround. |
void | setProxy(Proxy proxy) Sets the proxy for use with all the connections. |
void | setReceieveDataSocketBufferSize(int bufSize) Sets the value to be used for the data socket SO_RCVBUF option. |
void | setReceiveBufferSize(int size) Sets the underlying socket receive buffer size. |
void | setRemoteVerificationEnabled(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. |
void | setReportActiveExternalIPAddress(String ipAddress) Set the external IP address to report in EPRT/PORT commands in active mode. |
void | setRestartOffset(long offset) Sets the restart offset for file transfers. |
void | setSendBufferSize(int size) Set the underlying socket send buffer size. |
void | setSendDataSocketBufferSize(int bufSize) Sets the value to be used for the data socket SO_SNDBUF option. |
void | setSocketFactory(SocketFactory factory) Sets the SocketFactory used by the SocketClient to open socket connections. |
void | setSoTimeout(int timeout) Set the timeout in milliseconds of a currently open connection. |
void | setStrictMultilineParsing(boolean strictMultilineParsing) Set strict multiline parsing. |
void | setTcpNoDelay(boolean on) Enables or disables the Nagle's algorithm (TCP_NODELAY) on the currently opened socket. |
void | setUseEPSVwithIPv4(boolean selected) Set whether to use EPSV with IPv4. |
int | site(String parameters) A convenience method to send the FTP SITE command to the server, receive the reply, and return the reply code. |
boolean | storeFile(String remote, InputStream local) Stores a file on the server using the given name and taking input from the given InputStream. |
OutputStream | storeFileStream(String remote) Returns an OutputStream through which data can be written to store a file on the server using the given name. |
boolean | storeUniqueFile(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. |
int | user(String username) A convenience method to send the FTP USER command to the server, receive the reply, and return the reply code. |