|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectname.gries.Ftp
public class Ftp
| Field Summary | |
|---|---|
private static int |
CNTRL_PORT
|
private javax.microedition.io.StreamConnection |
csock
|
private java.io.InputStreamReader |
dcis
|
private boolean |
DEBUG
|
private javax.microedition.io.StreamConnection |
dsock
|
private boolean |
pauser
|
private java.io.PrintStream |
pos
|
| Constructor Summary | |
|---|---|
Ftp(java.lang.String server,
java.lang.String user,
java.lang.String pass)
ftp - default constructor |
|
| Method Summary | |
|---|---|
private java.lang.String |
bufferReader()
bufferReader() Method read the response of ftp commands until a \r \n. |
void |
download(java.lang.String dir,
java.lang.String file,
boolean asc)
download() Method send a command to the ftp server |
private void |
ftpConnect(java.lang.String server)
ftpConnect() Methode open a Connection to the specified server on standard ftp port 21 |
private javax.microedition.io.StreamConnection |
ftpGetDataSock()
ftpGetDataSock() Methode to create a data connection to the ftp server |
private void |
ftpLogin(java.lang.String user,
java.lang.String pass)
ftpLogin() Methode for login |
private void |
ftpLogout()
ftpLogout() Method lgout from the ftp server and close all streams and sockets |
private java.lang.String |
ftpSendCmd(java.lang.String cmd)
ftpSendCmd() Method send a command to the ftp server |
private void |
ftpSetDir(java.lang.String dir)
ftpSetDir() Methode for changing directories |
private void |
ftpSetTransferType(boolean asc)
ftpSetTransferType() Methode to set the transfer type |
private void |
getAsByte(java.io.InputStream is,
java.lang.String file)
getAsByte() Methode receive a file and stores the file in the flash file system |
private void |
readFileAndUpload(java.io.DataOutputStream dos,
java.lang.String file)
readFileAndUpload() Methode read a file and write it to the DataOutputStream. |
private java.lang.String |
responseHandler(java.lang.String cmd)
responseHandler() Method handle the multi-line replies, if more than one line returned |
private java.lang.String |
responseParser(java.lang.String resp)
responseParser() Method check first digit of first line of response and take action based on it set up to read an extra line if the response starts with "1" |
void |
upload(java.lang.String dir,
java.lang.String file,
boolean asc)
upload() Method send a command to the ftp server |
void |
uploadAppend(java.lang.String dir,
java.lang.String file,
boolean asc)
upload() Method send a command to the ftp server |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final int CNTRL_PORT
private javax.microedition.io.StreamConnection csock
private javax.microedition.io.StreamConnection dsock
private java.io.InputStreamReader dcis
private java.io.PrintStream pos
private boolean DEBUG
private boolean pauser
| Constructor Detail |
|---|
public Ftp(java.lang.String server,
java.lang.String user,
java.lang.String pass)
server - servernameuser - usernamepass - password| Method Detail |
|---|
public void download(java.lang.String dir,
java.lang.String file,
boolean asc)
throws java.io.IOException
dir - directory on the ftp serverfile - filename of the destination fileasc - transfer type true is Asccii and false is Binary
java.io.IOException
public void upload(java.lang.String dir,
java.lang.String file,
boolean asc)
throws java.io.IOException
dir - directory on the ftp serverfile - filename of the destination fileasc - transfer type true is Asccii and false is Binary
java.io.IOException
public void uploadAppend(java.lang.String dir,
java.lang.String file,
boolean asc)
throws java.io.IOException
dir - directory on the ftp serverfile - filename of the destination fileasc - transfer type true is Ascci and false is Binary
java.io.IOException
private void readFileAndUpload(java.io.DataOutputStream dos,
java.lang.String file)
throws java.io.IOException
dos - DataOutputStream for sending the file to the serverfile - file name for upload
java.io.IOException
private void getAsByte(java.io.InputStream is,
java.lang.String file)
throws java.io.IOException
is - InputStream to get the file from the serverfile - stores the data of the InputStream in the Flash under this file name
java.io.IOException
private void ftpConnect(java.lang.String server)
throws java.lang.InterruptedException,
java.io.IOException
server - server address
java.lang.InterruptedException
java.io.IOException
private void ftpLogin(java.lang.String user,
java.lang.String pass)
throws java.lang.InterruptedException,
java.io.IOException
user - user name of the ftp serverpass - password of the ftp server
java.lang.InterruptedException
java.io.IOException
private void ftpSetDir(java.lang.String dir)
throws java.io.IOException
dir - destination path
java.io.IOException
private void ftpSetTransferType(boolean asc)
throws java.io.IOException
asc - Asccii (true) or Binarie Mode (false)
java.io.IOException
private javax.microedition.io.StreamConnection ftpGetDataSock()
throws java.io.IOException
java.io.IOException
private java.lang.String ftpSendCmd(java.lang.String cmd)
throws java.io.IOException
cmd - Ftp command
java.io.IOException
private java.lang.String responseHandler(java.lang.String cmd)
throws java.io.IOException
cmd - is a String command or null
java.io.IOException
private java.lang.String responseParser(java.lang.String resp)
throws java.io.IOException
resp - is the respose of the ftp command
java.io.IOExceptionprivate void ftpLogout()
private java.lang.String bufferReader()
throws java.io.IOException
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||