|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectftp2me.Ftp2Me
public class Ftp2Me
Ftp client class for j2me Implements all of the RFC959 commands
| Field Summary | |
|---|---|
static int |
RESP_ALL
|
| Constructor Summary | |
|---|---|
Ftp2Me(java.lang.String host)
Create an instance of Ftp2Me. |
|
Ftp2Me(java.lang.String host,
int port)
Create an instance of Ftp2Me. |
|
Ftp2Me(java.lang.String host,
int port,
java.lang.String user,
java.lang.String pass)
Create an instance of Ftp2Me. |
|
Ftp2Me(java.lang.String host,
int port,
java.lang.String user,
java.lang.String pass,
java.lang.String acct)
Create an instance of Ftp2Me. |
|
| Method Summary | |
|---|---|
boolean |
abor()
Abort This command tells the server to abort the previous FTP service command and any associated transfer of data. |
void |
acct(java.lang.String account)
Account The argument field is a Telnet string identifying the user’s account. |
boolean |
allo(long size,
long maxRecordSize)
Allocate This command may be required by some servers to reserve sufficient storage to accommodate the new file to be transferred. |
void |
appe(java.io.InputStream is,
java.lang.String filename)
Append (with create) This command causes the server-DTP to accept the data transferred via the data connection and to store the data in a file at the server site. |
void |
cdup()
Change to parent directory This command is a special case of CWD, and is included to simplify the implementation of programs for transferring directory trees between operating systems having different syntaxes for naming the parent directory. |
void |
cwd(java.lang.String dir)
Changes the working directory This command allows the user to work with a different directory or dataset for file storage or retrieval without altering his login or accounting information. |
void |
dele(java.lang.String filename)
Delete This command causes the file specified in the pathname to be deleted at the server site. |
void |
disconnect()
Disconnects from the FTP server. |
void |
expectResponse(int expectedCode)
Gets a response. |
java.lang.String |
getLastMessage()
Returns the last message from the server. |
void |
help(java.lang.String command)
Help This command shall cause the server to send helpful information regarding its implementation status over the control connection to the user. |
boolean |
isNegativePermanent()
Is the last message a negative permanent reply? |
boolean |
isNegativeTransient()
Is the last message a negative transient reply? |
boolean |
isPositiveCompletion()
Is the last message a positive completion reply? |
boolean |
isPositiveIntermediate()
Is the last message a positive intermediate reply? |
boolean |
isPositivePreliminary()
Is the last message a positive preliminary reply? |
java.util.Enumeration |
list()
List This command causes a list to be sent from the server to the passive DTP. |
void |
mkd(java.lang.String pathname)
Make directory This command causes the directory specified in the pathname to be created as a directory (if the pathname is absolute) or as a subdirectory of the current working directory (if the pathname is relative). |
void |
mode(char mode)
Transfer mode The argument is a single Telnet character code specifying the data transfer modes described in the Section on Transmission Modes. |
java.util.Enumeration |
nlst()
Name list This command causes a directory listing to be sent from server to user site. |
void |
noop()
No operation This command does not affect any parameters or previously entered commands. |
void |
pass(java.lang.String pass)
Password The argument field is a Telnet string specifying the user’s password. |
PasvInfo |
pasv()
Passive This command requests the server-DTP to "listen" on a data port (which is not its default data port) and to wait for h1 connection rather than initiate one upon receipt of h1 transfer command. |
void |
port(int h1,
int h2,
int h3,
int h4,
int port)
Data port The argument is a HOST-PORT specification for the data port to be used in data connection. |
java.lang.String |
pwd()
Print working directory This command causes the name of the current working directory to be returned in the reply. |
void |
quit()
Quit This command terminates a USER and if file transfer is not in progress, the server closes the control connection. |
void |
rein()
Reinitialize This command terminates a USER, flushing all I/O and account information, except to allow any transfer in progress to be completed. |
void |
rest(java.lang.String marker)
Restart file transfer The argument field represents the server marker at which file transfer is to be restarted. |
void |
retr(java.io.OutputStream outputStream,
java.lang.String filename)
Retrieve This command causes the server-DTP to transfer a copy of the file, specified in the pathname, to the server- or user-DTP at the other end of the data connection. |
void |
rmd(java.lang.String pathname)
Remove directory This command causes the directory specified in the pathname to be removed as a directory (if the pathname is absolute) or as a subdirectory of the current working directory (if the pathname is relative). |
void |
rnfr(java.lang.String pathname)
Rename from This command specifies the old pathname of the file which is to be renamed. |
void |
rnto(java.lang.String pathname)
Rename to This command specifies the new pathname of the file specified in the immediately preceding "rename from" command. |
void |
site()
Site parameters This command is used by the server to provide services specific to his system that are essential to file transfer but not sufficiently universal to be included as commands in the protocol. |
void |
smnt(java.lang.String pathname)
Structure mount This command allows the user to mount a different file system data structure without altering his login or accounting information. |
void |
stat(java.lang.String pathname)
Status This command shall cause a status response to be sent over the control connection in the form of a reply. |
void |
stor(java.io.InputStream is,
java.lang.String filename)
Store This command causes the server-DTP to accept the data transferred via the data connection and to store the data as a file at the server site. |
void |
stou(java.io.InputStream is,
java.lang.String filename)
Store unique This command behaves like STOR except that the resultant file is to be created in the current directory under a name unique to that directory. |
void |
stru(char structure)
File structure The argument is a single Telnet character code specifying file structure described in the Section on Data Representation and Storage. |
void |
syst()
System This command is used to find out the type of operating system at the server. |
void |
type(char type)
Calls type(type, 8) ( see type(char type, int bytesize) ) |
void |
type(char type,
int bytesize)
Set transfer type. |
void |
user(java.lang.String user)
User name The argument field is a Telnet string identifying the user. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int RESP_ALL
| Constructor Detail |
|---|
public Ftp2Me(java.lang.String host)
throws java.io.IOException,
FtpProtocolException
host - Name of the host to connect to
IOException, - FtpProtocolException
java.io.IOException
FtpProtocolException
public Ftp2Me(java.lang.String host,
int port)
throws java.io.IOException,
FtpProtocolException
host - Name of the host to connect toport - Port on the host to connect to
IOException, - FtpProtocolException
java.io.IOException
FtpProtocolException
public Ftp2Me(java.lang.String host,
int port,
java.lang.String user,
java.lang.String pass)
throws java.io.IOException,
FtpProtocolException
host - Name of the host to connect toport - Port on the host to connect touser - Username to use for loginpass - Password to use for login
IOException, - FtpProtocolException
java.io.IOException
FtpProtocolException
public Ftp2Me(java.lang.String host,
int port,
java.lang.String user,
java.lang.String pass,
java.lang.String acct)
throws java.io.IOException,
FtpProtocolException
host - Name of the host to connect toport - Port on the host to connect touser - Username to use for loginpass - Password to use for loginacct - Account name to use with acct command
IOException, - FtpProtocolException
java.io.IOException
FtpProtocolException| Method Detail |
|---|
public void disconnect()
public boolean abor()
throws java.io.IOException,
FtpProtocolException
java.io.IOException
FtpProtocolException
public void acct(java.lang.String account)
throws java.io.IOException,
FtpProtocolException
java.io.IOException
FtpProtocolException
public boolean allo(long size,
long maxRecordSize)
throws java.io.IOException,
FtpProtocolException
java.io.IOException
FtpProtocolException
public void appe(java.io.InputStream is,
java.lang.String filename)
throws java.io.IOException,
FtpProtocolException
java.io.IOException
FtpProtocolException
public void cdup()
throws java.io.IOException,
FtpProtocolException
java.io.IOException
FtpProtocolException
public void cwd(java.lang.String dir)
throws java.io.IOException,
FtpProtocolException
java.io.IOException
FtpProtocolException
public void dele(java.lang.String filename)
throws java.io.IOException,
FtpProtocolException
java.io.IOException
FtpProtocolException
public void help(java.lang.String command)
throws java.io.IOException,
FtpProtocolException
java.io.IOException
FtpProtocolException
public java.util.Enumeration list()
throws java.io.IOException,
FtpProtocolException
java.io.IOException
FtpProtocolException
public void mkd(java.lang.String pathname)
throws java.io.IOException,
FtpProtocolException
java.io.IOException
FtpProtocolException
public void mode(char mode)
throws java.io.IOException,
FtpProtocolException
java.io.IOException
FtpProtocolException
public java.util.Enumeration nlst()
throws java.io.IOException,
FtpProtocolException
java.io.IOException
FtpProtocolException
public void noop()
throws java.io.IOException,
FtpProtocolException
java.io.IOException
FtpProtocolException
public void pass(java.lang.String pass)
throws java.io.IOException,
FtpProtocolException
java.io.IOException
FtpProtocolException
public PasvInfo pasv()
throws java.io.IOException,
FtpProtocolException
java.io.IOException
FtpProtocolException
public void port(int h1,
int h2,
int h3,
int h4,
int port)
throws java.io.IOException,
FtpProtocolException
java.io.IOException
FtpProtocolException
public java.lang.String pwd()
throws java.io.IOException,
FtpProtocolException
java.io.IOException
FtpProtocolException
public void quit()
throws java.io.IOException,
FtpProtocolException
java.io.IOException
FtpProtocolException
public void rein()
throws java.io.IOException,
FtpProtocolException
java.io.IOException
FtpProtocolException
public void rest(java.lang.String marker)
throws java.io.IOException,
FtpProtocolException
java.io.IOException
FtpProtocolException
public void retr(java.io.OutputStream outputStream,
java.lang.String filename)
throws java.io.IOException,
FtpProtocolException
java.io.IOException
FtpProtocolException
public void rmd(java.lang.String pathname)
throws java.io.IOException,
FtpProtocolException
java.io.IOException
FtpProtocolException
public void rnfr(java.lang.String pathname)
throws java.io.IOException,
FtpProtocolException
java.io.IOException
FtpProtocolException
public void rnto(java.lang.String pathname)
throws java.io.IOException,
FtpProtocolException
java.io.IOException
FtpProtocolException
public void site()
throws java.io.IOException,
FtpProtocolException
java.io.IOException
FtpProtocolException
public void smnt(java.lang.String pathname)
throws java.io.IOException,
FtpProtocolException
java.io.IOException
FtpProtocolException
public void stat(java.lang.String pathname)
throws java.io.IOException,
FtpProtocolException
java.io.IOException
FtpProtocolException
public void stor(java.io.InputStream is,
java.lang.String filename)
throws java.io.IOException,
FtpProtocolException
java.io.IOException
FtpProtocolException
public void stou(java.io.InputStream is,
java.lang.String filename)
throws java.io.IOException,
FtpProtocolException
java.io.IOException
FtpProtocolException
public void stru(char structure)
throws java.io.IOException,
FtpProtocolException
java.io.IOException
FtpProtocolException
public void syst()
throws java.io.IOException,
FtpProtocolException
java.io.IOException
FtpProtocolException
public void type(char type)
throws java.io.IOException,
FtpProtocolException
java.io.IOException
FtpProtocolException
public void type(char type,
int bytesize)
throws java.io.IOException,
FtpProtocolException
java.io.IOException
FtpProtocolException
public void user(java.lang.String user)
throws java.io.IOException,
FtpProtocolException
java.io.IOException
FtpProtocolExceptionpublic java.lang.String getLastMessage()
public void expectResponse(int expectedCode)
throws java.io.IOException,
FtpProtocolException
java.io.IOException
FtpProtocolExceptionpublic boolean isPositivePreliminary()
public boolean isPositiveCompletion()
public boolean isPositiveIntermediate()
public boolean isNegativeTransient()
public boolean isNegativePermanent()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||