public class FTPClient
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
READ_TIMEOUT |
| Constructor and Description |
|---|
FTPClient() |
| Modifier and Type | Method and Description |
|---|---|
FTPReply |
binary() |
void |
closeDataStream() |
FTPReply |
connect(java.lang.String host)
Connects to the given FTP host on the default port.
|
void |
disconnect()
Disconnects from the host to which we are currently connected.
|
FTPReply |
executeCommand(java.lang.String command)
Executes the given FTP command on our current connection, returning the
three digit response code from the server.
|
java.io.InputStream |
getDataStream() |
FTPReply |
getReply() |
FTPReply |
login(java.lang.String username,
java.lang.String password)
Wrapper for the commands
user [username] and pass
[password]. |
FTPReply |
pasv() |
FTPReply |
quit() |
FTPReply |
retr(java.lang.String file) |
void |
setRestPosition(long position) |
FTPReply |
size(java.lang.String file)
Return the size of the remote file
|
public FTPReply connect(java.lang.String host) throws java.io.IOException
java.io.IOExceptionpublic FTPReply executeCommand(java.lang.String command) throws java.io.IOException
java.io.IOExceptionpublic FTPReply login(java.lang.String username, java.lang.String password) throws java.io.IOException
user [username] and pass
[password].java.io.IOExceptionpublic FTPReply quit() throws java.io.IOException
java.io.IOExceptionpublic FTPReply binary() throws java.io.IOException
java.io.IOExceptionpublic FTPReply pasv() throws java.io.IOException
java.io.IOExceptionpublic void setRestPosition(long position)
public FTPReply retr(java.lang.String file) throws java.io.IOException
java.io.IOExceptionpublic FTPReply getReply() throws java.io.IOException
java.io.IOExceptionpublic FTPReply size(java.lang.String file) throws java.io.IOException
file - java.io.IOExceptionpublic java.io.InputStream getDataStream()
throws java.io.IOException
java.io.IOExceptionpublic void closeDataStream()
throws java.io.IOException
java.io.IOExceptionpublic void disconnect()