|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.di.protocols.FTP
public class FTP
This class implements the FTP functionality using a FTPClient object.
Constructor Summary | |
---|---|
FTP()
Constructor. |
Method Summary | |
---|---|
boolean |
cd(java.lang.String path)
Changes the current working directory on the FTP server. |
boolean |
close()
Closes the connection to the FTP server. |
boolean |
connect(java.lang.String host)
Connects to a given host on port 21. |
boolean |
connect(java.lang.String host,
int port)
Connects to a given host and port. |
java.lang.Object[] |
dir()
Lists the contents of the current working directory. |
boolean |
get(java.lang.String remoteFile,
java.lang.String localFile)
Gets a remote file from the FTP server. |
java.lang.Exception |
getLastError()
Returns the last exception occurred. |
java.lang.String |
getResponse()
Returns the FTP server response to a previously sent command. |
boolean |
login(java.lang.String username,
java.lang.String password)
Logins the FTP client on the server with the given credentials. |
boolean |
put(java.lang.String localFile,
java.lang.String remoteFile)
Puts a remote file on the FTP server. |
boolean |
setAscii()
Sets the transfer mode to ASCII. |
boolean |
setBinary()
Sets the transfer mode to binary. |
boolean |
setLastErr(java.lang.Exception e)
Sets the passed as parameter exception as the last exception of the FTP client so far. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FTP()
Method Detail |
---|
public boolean connect(java.lang.String host)
host
- the host of the FTP server.
public boolean connect(java.lang.String host, int port)
host
- the host of the FTP server.port
- the port to connect to.
public boolean login(java.lang.String username, java.lang.String password)
username
- the username used to login.password
- the password used to login.
public boolean close()
public boolean setBinary()
public boolean setAscii()
public boolean get(java.lang.String remoteFile, java.lang.String localFile)
remoteFile
- a file to be copied.localFile
- the name of the file used when saving it on the local machine.
public boolean put(java.lang.String localFile, java.lang.String remoteFile)
remoteFile
- the name used to save the file on the remote server.localFile
- the file to be sent to the FTP server.
public boolean cd(java.lang.String path)
path
- the new directory.
public java.lang.String getResponse()
public java.lang.Object[] dir()
public boolean setLastErr(java.lang.Exception e)
e
- an exception.
null
, otherwise
false.public java.lang.Exception getLastError()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |