|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.dalsemi.protocol.BasicClient | +--com.dalsemi.protocol.ftp.FTPClient
Field Summary | |
boolean |
binary
Binary/ASCII mode flag. |
static java.lang.String |
TIMEOUT_PROPERTY_STRING
System property String used to find a default socket timeout. |
Fields inherited from class com.dalsemi.protocol.BasicClient |
cin,
control,
controlPort,
controlServer,
cout,
data,
dataPort,
dataServer,
din,
dout |
Constructor Summary | |
FTPClient(java.lang.String SERVER)
Create a connection to an FTP server running at the specified server on the default FTP port (21). |
|
FTPClient(java.lang.String SERVER,
int PORT)
Create a connection to an FTP server running at the specified server on the specified port. |
Method Summary | |
void |
analyze(int code)
Outputs an IOException with meaningful messages in the event of bad FTP return codes. |
int |
ascii()
Changes to ASCII transfer mode. |
int |
binary()
Changes to binary transfer mode. |
void |
close()
Attempts to close all socket socket resources that may have been left open by any operation. |
int |
dataConnection()
Sets up a connection to transfer a file either by entering passive mode or by making a connection using the PORT command. |
int |
ePassiveConnection()
Sets up an enhanced passive connection to the FTP server. |
java.io.InputStream |
getDataStream()
Gets the stream to read the file or directory listing information we had earlier requested using retr . |
int |
getFileSize()
Get the size of a file we are downloading. |
java.lang.String |
getLastCommand()
Gets the last command string that we sent to the FTP server. |
java.io.OutputStream |
getOutputStream()
Gets the stream to write file information. |
java.lang.String |
getResponseString()
Gets the last response string that we recieved from the FTP server. |
int |
issueCommand(java.lang.String command)
Sends a command to the FTP server and returns the success code reported by the FTP server. |
int |
list(java.lang.String path)
List the files in a directory pointed to by the path. |
int |
passiveConnection()
Sets up a passive connection to the FTP server. |
int |
password(java.lang.String password)
Sends a password to the FTP server. |
int |
port()
Sets up a connection to transfer a file by using the PORT command. |
int |
quit()
Logs out of the FTP server, and closes the FTP session. |
int |
retr(java.lang.String path)
Issues a command to get a file from an FTP server. |
int |
userName(java.lang.String user)
Sends a user name to login to an FTP server. |
Methods inherited from class com.dalsemi.protocol.BasicClient |
command,
command,
getTimeout,
readDataStream,
setTimeout,
setupDataSocket |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final java.lang.String TIMEOUT_PROPERTY_STRING
public boolean binary
binary
and ascii
methods
instead.binary()
,
ascii()
Constructor Detail |
public FTPClient(java.lang.String SERVER) throws java.io.IOException
SERVER
- address of the FTP server to connect topublic FTPClient(java.lang.String SERVER, int PORT) throws java.io.IOException
SERVER
- address of the FTP server to connect toPORT
- port number the FTP server is listening onMethod Detail |
public int userName(java.lang.String user) throws java.io.IOException
user
- User name for FTP login, or null
to use anonymous.public int password(java.lang.String password) throws java.io.IOException
userName
method. If we are doing anonymous
login, send something that looks like an email address.password
- The password to login to an FTP server. If null
,
the string user@ will be sent.userName(java.lang.String)
public int binary() throws java.io.IOException
public int ascii() throws java.io.IOException
public int passiveConnection() throws java.io.IOException
public int ePassiveConnection() throws java.io.IOException
public int dataConnection() throws java.io.IOException
public int port() throws java.io.IOException
public int retr(java.lang.String path) throws java.io.IOException
#getDataStream
method should be called to read the file data.path
- path to the file on the FTP server to downloadpublic int list(java.lang.String path) throws java.io.IOException
path
- directory name to get the listing for. If path
is null
, the directory listing for the current
directory is requestedpublic int getFileSize()
public int quit() throws java.io.IOException
public int issueCommand(java.lang.String command) throws java.io.IOException
command
- string command to be send to the FTP server.
command
must include the end-of-line
sequence if it is requiredpublic java.io.InputStream getDataStream() throws java.io.IOException
retr
.retr(java.lang.String)
public java.io.OutputStream getOutputStream() throws java.io.IOException
put
method. Please see the Slush command source file
com.dalsemi.slush.command.FTPCommand
for
a way to implement the common FTP put command.public void analyze(int code) throws java.io.IOException
code
- FTP response code to get a readable string forpublic java.lang.String getResponseString()
public java.lang.String getLastCommand()
public void close()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |