| Modifier and Type | Class and Description |
|---|---|
| private class | |
| private static class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final boolean | |
| private int | |
| private static int | |
| private static int | |
| private DateFormat | |
| private static String | |
| private static Pattern | |
| pack-priv static final String | |
| private InputStream | |
| private String | |
| private FtpReplyCode | lastReplyCode
The last reply code from the ftp daemon. |
| private long | |
| private static Pattern | |
| private boolean | |
| private static final PlatformLogger | |
| private FtpDirParser | |
| private Socket | |
| private PrintStream | |
| private FtpDirParser | |
| private final boolean | passiveMode
Only passive mode used in JDK. |
| private static Pattern | |
| private static String[] | patStrings
Static members used by the parser |
| private static int[][] | |
| private static Pattern[] | |
| private Proxy | |
| private int | |
| private boolean | |
| private long | |
| private static final DateTimeFormatter | |
| private Socket | |
| private InetSocketAddress | serverAddr
remember the ftp server name because we may need it |
| private Vector | serverResponse
Array of strings (usually 1 entry) for the last reply from the server. |
| private SSLSocketFactory | |
| private static Pattern | |
| private FtpClient. | |
| private boolean | |
| private String | welcomeMsg
Welcome message from the server, if any. |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public FtpClient | Returns: true if the command was successful.Implements abstract sun. sends the ABOR command to the server. |
| public FtpClient | Returns: true if the operation was successful.The number of bytes to allocate. size)Implements abstract sun. Sends the "Allocate" (ALLO) command to the server telling it to pre-allocate the specified number of bytes for the next transfer. |
| public FtpClient | Returns: true if the transfer was successful.A name, InputStream String containing the name of the remote file
to append to.The local)InputStream providing access to the data
to be appended.Implements abstract sun. Sends the APPE command to the server in order to transfer a data stream passed in argument and append it to the content of the specified remote file. |
| public FtpClient | Returns: true if the operation was successful.path of the directory to CD to. remoteDirectory)Implements abstract sun. Changes to a specific directory on a remote FTP server |
| public FtpClient | Returns: true if the command was successful.Implements abstract sun. Changes to the parent directory, sending the CDUP command to the server. |
| public void | close()
Implements abstract sun. Implements java. Logs out the current user. |
| public FtpClient | Returns: true if the completion was successful or if no
action was pending.Implements abstract sun. Some methods do not wait until completion before returning, so this method can be called to wait until completion. |
| public FtpClient | connect(SocketAddress dest)
Implements abstract sun. Connects the |
| public FtpClient | connect(SocketAddress
the address of the destination server dest, int timeout)Implements abstract sun. Connects the FtpClient to the specified destination. |
| public static FtpClient | |
| private InputStream | |
| private OutputStream | |
| public FtpClient | Returns: true if the command was successfula name)String containing the name of the file
to delete.Implements abstract sun. Deletes a file on the server. |
| private void | |
| private Socket | |
| public FtpClient | Returns: This FtpClientImplements abstract sun. Set the transfer mode to passive. |
| public FtpClient | Returns: true if the operation was successful.Implements abstract sun. Sends a |
| private static InetAddress[] | |
| public int | Returns: the value, in milliseconds, of the current connect timeout.Implements abstract sun. Returns the current connection timeout value. |
| public List | Returns: aList of Strings describing the
supported additional features, or null
if the command is not supported.Implements abstract sun. Sends the FEAT command to the server and returns the list of supported features in the form of strings. |
| public FtpClient | getFile(String
a name, OutputStream String containing the name of the file to
retrieve from the server.the local)OutputStream the file should be written to.Implements abstract sun. Retrieves a file from the ftp server and writes it to the specified
|
| public InputStream | getFileStream(String
the name of the remote file name)Implements abstract sun. Retrieves a file from the ftp server, using the RETR command, and returns the InputStream from* the established data connection. |
| public String | Returns: aString containing the text sent back by the
server, or null if the command failed.the command for which the help is requested or
cmd)null for the general helpImplements abstract sun. Sends the HELP command to the server, with an optional command, like SITE, and returns the text sent back by the server. |
| public String | Returns: the name the latest transferred file remote name, ornull if that information is unavailable.Implements abstract sun. Returns, when available, the remote name of the last transferred file. |
| public Date | Returns: aDate representing the last modification time
or null if the server returned an error, which
can be checked with getLastReplyCode().a path)String containing the pathname of the file.Implements abstract sun. Issues the MDTM [path] command to the server to get the modification time of a specific file on the server. |
| public FtpReplyCode | Returns: the lastReplyCodeImplements abstract sun. Returns the last reply code sent by the server. |
| public String | Returns: the message string, which can be quite long, last returned by the server.Implements abstract sun. Returns the last response string sent by the server. |
| public long | Returns: the size of the latest transfer or -1 if either there was no transfer or the information was unavailable.Implements abstract sun. Returns, when available, the size of the latest started transfer. |
| private static InetAddress | |
| public Proxy | Returns: theProxy, this client is using, or null
if none is used.Implements abstract sun. Get the proxy of this FtpClient |
| public int | Returns: the value, in milliseconds, of the current read timeout.Implements abstract sun. Returns the current read timeout value. |
| private String | |
| private Vector | |
| private byte[] | |
| public SocketAddress | getServerAddress()
Implements abstract sun. Retrieves the address of the FTP server this client is connected to. |
| public long | Returns: along containing the size of the file or -1 if
the server returned an error, which can be checked with
getLastReplyCode().a path)String containing the pathname of the
file.Implements abstract sun. Issues the SIZE [path] command to the server to get the size of a specific file on the server. |
| public String | Returns: the response from the server ornull if the
command failed.an optional name)String containing the pathname
the STAT command should apply to.Implements abstract sun. Sends the STAT command to the server. |
| public String | Returns: aString describing the OS, or null
if the operation was not successful.Implements abstract sun. Sends a SYST (System) command to the server and returns the String sent back by the server describing the operating system at the server. |
| private void | getTransferName()
extract the created file name from the response string: 226 Transfer complete (unique file name:toto.txt.1). |
| private void | |
| public String | Returns: aString containing the message the server
returned during connection or null.Implements abstract sun. Returns the Welcome string the server sent during initial connection. |
| public String | Returns: aString containing the current working directory,
or nullImplements abstract sun. Returns the server current working directory, or |
| private static boolean | isASCIISuperset(String encoding)
Test the named character encoding to verify that it converts ASCII characters correctly. |
| public boolean | Returns: true if the client is connected.Implements abstract sun. Tests whether this client is connected or not to a server. |
| public boolean | Returns: true if the client has already completed a login.Implements abstract sun. Checks whether the client is logged in to the server or not. |
| public boolean | Returns: the currentFtpTransferModeImplements abstract sun. Gets the current transfer mode. |
| private boolean | Returns: true if the command was successfulSends a command to the FTP server and returns the error code (which can be a "success") sent by the server. |
| private void | issueCommandCheck(String
String containing the command cmd)Send a command to the FTP server and check for success. |
| public InputStream | Returns: theInputStream from the resulting data connectionthe pathname of the directory to list, or path)null
for the current working directory.Implements abstract sun. Issues a LIST command to the server to get the current directory listing, and returns the InputStream from the data connection. |
| public Iterator | Returns: aIterator of files or null if the
command failed.the pathname of the directory to list or path)null
for the current working directory.Implements abstract sun. Issues a MLSD command to the server to get the specified directory
listing and applies the current parser to create an Iterator of
|
| public FtpClient | Returns: true if the login was successful.The user name user, char[] The password for that user password)Implements abstract sun. Attempts to log on the server with the specified user name and password. |
| public FtpClient | Returns: true if the login was successful.The user name user, char[] The password for that user. password, String The account name for that user. account)Implements abstract sun. Attempts to log on the server with the specified user name, password and account name. |
| public FtpClient | Returns: true if the operation was successful.a name)String containing the name of the directory
to create.Implements abstract sun. Creates a new directory on the server. |
| public InputStream | Returns: theInputStream from the resulting data connectiona path)String containing the pathname of the
directory to list or null for the current working
directory.Implements abstract sun. Issues a NLST path command to server to get the specified directory content. |
| public FtpClient | |
| private Socket | Returns: the connectedSocketthe cmd)String containing the command to executeOpens a data connection with the server according to the set mode (ACTIVE or PASSIVE) then send the command passed as an argument. |
| private Socket | Returns: the connectedSocketOpens a "PASSIVE" connection with the server and returns the connected
|
| private static Date | |
| public FtpClient | Returns: true if the transfer was successful.the name of the remote file to write. name, InputStream the local, boolean InputStream that points to the data to
transfer.true if the remote file should be unique
(i.e. not already existing), false otherwise.Implements abstract sun. Transfers a file from the client to the server (aka a put) by sending the STOR command. |
| public OutputStream | putFileStream(String
the name of the remote file to write. name, boolean true if the remote files should be unique,
in which case the STOU command will be used.Implements abstract sun. Transfers a file from the client to the server (aka a put)
by sending the STOR or STOU command, depending on the
|
| private boolean | |
| private int | |
| public FtpClient | reInit()
Implements abstract sun. Reinitializes the USER parameters on the FTP server |
| public FtpClient | Returns: true if the operation was successful.a name)String containing the name of the directory
to remove.Implements abstract sun. Removes a directory on the server. |
| public FtpClient | rename(String
the name of the file being renamed from, String the new name for the file to)Implements abstract sun. Renames a file on the server. |
| private boolean | |
| private void | |
| public FtpClient | Returns: This FtpClientthe timeout value, in milliseconds, to use for the connect
operation. A value of zero or less, means use the default timeout. timeout)Implements abstract sun. Sets the timeout value to use when connecting to the server, |
| public FtpClient | setDirParser(FtpDirParser
The p)FtpDirParser to use.Implements abstract sun. Sets the parser used to handle the directory output to the specified one. |
| public FtpClient | setProxy(Proxy p)
Implements abstract sun. Set the |
| public FtpClient | Returns: This FtpClientthe timeout value, in milliseconds, to use for the read
operation. A value of zero or less, means use the default timeout. timeout)Implements abstract sun. Sets the timeout value to use when reading from the server, |
| public FtpClient | setRestartOffset(long
the offset in the remote file at which to start the next
transfer. This must be a value greater than or equal to zero. offset)Implements abstract sun. Sets the restart offset to the specified value. |
| public FtpClient | Returns: This FtpClientthe typeFtpTransferType to use.Implements abstract sun. Changes the transfer type (binary, ascii, ebcdic) and issue the proper command (e.g. TYPE A) to the server. |
| public FtpClient | Returns: true if the command was successful.the command to be sent. cmd)Implements abstract sun. Sends the SITE command to the server. |
| public FtpClient | Returns: true if the operation was successful.Implements abstract sun. Attempts to switch to a secure, encrypted connection. |
| public FtpClient | Returns: true if the operation was successful.a struct)String containing the name of the
structure to mount.Implements abstract sun. Sends the "Structure Mount" (SMNT) command to the server. |
| private void | tryConnect(InetSocketAddress
the dest, int timeout)InetSocketAddress to connect to.Connects to the specified destination. |
| private void | |
| public FtpClient | Returns: true if authentication was successful.Implements abstract sun. Attempts to use Kerberos GSSAPI as an authentication mechanism with the ftp server. |
| private InetSocketAddress | validatePasvAddress(int port, String s, InetAddress address)
Returns an InetSocketAddress, based on value of acceptPasvAddressVal and other conditions such as the server address returned by pasv is not a hostname, is a socks proxy, or the loopback. |