public class FtpClient extends Object
| Constructor and Description |
|---|
FtpClient(InputStream controlIn,
OutputStream controlOut,
InetAddress controlLocalAddress) |
| Modifier and Type | Method and Description |
|---|---|
void |
active(int port) |
void |
changeWorkingDirectory(String directory)
Changes the remote working directory.
|
void |
dispose()
Releases all resources associated with the connection to the FTP server, specifically an open data
connection.
|
void |
login(String user,
String password)
Logs in to the remote FTP server.
|
void |
passive()
Switches fro ACTIVE to PASSIVE mode.
|
InputStream |
retrieve(String fileName)
The caller is responsible for closing the returned
InputStream. |
void |
setDataConnectionAcceptTimeout(int dataConnectionAcceptTimeout) |
public FtpClient(InputStream controlIn, OutputStream controlOut, InetAddress controlLocalAddress) throws IOException
IOExceptionpublic void setDataConnectionAcceptTimeout(int dataConnectionAcceptTimeout)
ServerSocket.setSoTimeout(int)public void login(String user, String password) throws IOException
IOExceptionpublic void changeWorkingDirectory(String directory) throws IOException
IOExceptionpublic void passive()
throws IOException
IOExceptionpublic void active(int port)
throws IOException
port - Pass 0 to pick an ephemeral port.IOExceptionpublic InputStream retrieve(String fileName) throws IOException
InputStream.IOExceptionpublic void dispose()
Copyright © 2018 Arno Unkrig. All rights reserved.