public class FTPClient extends Object
Modifier and Type | Field | Description |
---|---|---|
static int |
READ_TIMEOUT |
Constructor | Description |
---|---|
FTPClient() |
Modifier and Type | Method | 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
IOException
public FTPReply executeCommand(String command) throws IOException
IOException
public FTPReply login(String username, String password) throws IOException
user [username]
and pass
[password]
.IOException
public FTPReply quit() throws IOException
IOException
public FTPReply binary() throws IOException
IOException
public FTPReply pasv() throws IOException
IOException
public void setRestPosition(long position)
public FTPReply retr(String file) throws IOException
IOException
public FTPReply getReply() throws IOException
IOException
public FTPReply size(String file) throws IOException
file
- IOException
public InputStream getDataStream() throws IOException
IOException
public void closeDataStream() throws IOException
IOException
public void disconnect()