public class FTPClient extends 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(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(String command)
Executes the given FTP command on our current connection, returning the
three digit response code from the server.
|
InputStream |
getDataStream() |
FTPReply |
getReply() |
FTPReply |
login(String username,
String password)
Wrapper for the commands
user [username] and pass
[password]. |
FTPReply |
pasv() |
FTPReply |
quit() |
FTPReply |
retr(String file) |
void |
setRestPosition(long position) |
FTPReply |
size(String file)
Return the size of the remote file
|
public FTPReply connect(String host) throws IOException
IOExceptionpublic FTPReply executeCommand(String command) throws IOException
IOExceptionpublic FTPReply login(String username, String password) throws IOException
user [username] and pass
[password].IOExceptionpublic FTPReply quit() throws IOException
IOExceptionpublic FTPReply binary() throws IOException
IOExceptionpublic FTPReply pasv() throws IOException
IOExceptionpublic void setRestPosition(long position)
public FTPReply retr(String file) throws IOException
IOExceptionpublic FTPReply getReply() throws IOException
IOExceptionpublic FTPReply size(String file) throws IOException
file - IOExceptionpublic InputStream getDataStream() throws IOException
IOExceptionpublic void closeDataStream()
throws IOException
IOExceptionpublic void disconnect()