Embedded FTP client.
Constructor
Creates and returns FtpClient.
Optionally opens connection to given host and port.
If error occured null is returned.
| Throws |
IOError -
if an IO error occured
|
Methods
Appends to a file in server and returns output stream to write to
| Returns |
output stream |
| Throws |
IOError -
If operation failed
|
Sets transfer type to 'A'.
| Throws |
IOError -
If operation failed
|
Sets transfer type to 'B'.
| Throws |
IOError -
If operation failed
|
Changes remote directory.
| Parameters |
dir -
remote directory
|
| Throws |
IOError -
If operation failed
|
Moves to parent directory.
| Throws |
IOError -
If operation failed
|
Closes connection.
| Returns |
true if ok |
| Throws |
IOError -
If operation failed
|
Gets and returns the input stream to given file.
Returned stream should not be closed because that
will close the connection as well.
| Parameters |
fileName -
file name
|
| Returns |
input stream to given file |
| Throws |
IOError -
if error occurred
|
Checks if connection is open.
Lists files (and information in current remote directory.
| Returns |
InputStream containing directory list |
| Throws |
IOError -
If operation failed
|
Logs into server with given 'username' and 'password'.
| Parameters |
username -
password -
|
| Throws |
IOError -
if login was not succesful
|
Opens connection to given 'host' (and 'port').
| Parameters |
host -
host name
port -
port number
|
| Throws |
IOError -
If operation failed
AccessDenied -
If security policy denies this operation
|
Puts a file into server and returns output stream to write to
| Returns |
output stream |
| Throws |
IOError -
If operation failed
|
Returns the current directory.
| Throws |
IOError -
If operation failed
|
Renames a file in server.
| Throws |
IOError -
If operation failed
|