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
IOException
public void setDataConnectionAcceptTimeout(int dataConnectionAcceptTimeout)
ServerSocket.setSoTimeout(int)
public void login(String user, String password) throws IOException
IOException
public void changeWorkingDirectory(String directory) throws IOException
IOException
public void passive() throws IOException
IOException
public void active(int port) throws IOException
port
- Pass 0 to pick an ephemeral port.IOException
public InputStream retrieve(String fileName) throws IOException
InputStream
.IOException
public void dispose()
Copyright © 2018 Arno Unkrig. All rights reserved.