Logo Search packages:      
Sourcecode: jftp version File versions  Download package

net::sf::jftp::net::FtpConnection Class Reference

Inheritance diagram for net::sf::jftp::net::FtpConnection:

net::sf::jftp::net::BasicConnection net::sf::jftp::net::FtpConstants

List of all members.


Detailed Description

All control transactions are made here. See doc/FtpDownload.java for examples and note that this class is event-driven and not Exception-based! You might want to take a look at ConnectionListener, too.

Author:
David Hansmann, hansmann.d@debitel.net
Version:
1.30+, June 2003

Definition at line 52 of file FtpConnection.java.


Public Member Functions

void abort ()
void abortTransfer ()
void addConnectionListener (ConnectionListener l)
void ascii ()
void binary ()
boolean cdup ()
boolean chdir (String p)
boolean chdirNoRefresh (String p)
boolean chdirRaw (String dirName)
void disconnect ()
int download (String file)
int exists (String file)
void fireActionFinished (FtpConnection con)
void fireConnectionFailed (FtpConnection con, String why)
void fireConnectionInitialized (FtpConnection con)
void fireDirectoryUpdate (FtpConnection con)
void fireProgressUpdate (String file, String type, long bytes)
 FtpConnection (String host, int port, String initCWD, String crlfx)
 FtpConnection (String host, int port, String initCWD)
 FtpConnection (String host)
String getCachedPWD ()
BufferedReader getCommandInputReader ()
OutputStream getCommandOutputStream ()
ConnectionHandler getConnectionHandler ()
String getCRLF ()
DataConnection getDataConnection ()
InputStream getDownloadInputStream (String file)
String getHost ()
BufferedReader getIn ()
FtpTransfer getLastInitiatedTransfer ()
String getLine (String[] until)
String getLine (String until)
String getLocalPath ()
String getOsType ()
String getPassword ()
int[] getPermissions ()
int getPort ()
String getPWD ()
String getTypeNow ()
String getUsername ()
int handleDownload (String file)
int handleUpload (String file, String realName)
int handleUpload (String file)
boolean isConnected ()
void list () throws IOException
int login (String username, String password)
boolean mkdir (String dirName)
String mode (String code)
void modeBlocked ()
void modeCompressed ()
void modeStream ()
void noop ()
void pause (int time)
int removeFileOrDir (String file)
boolean rename (String from, String to)
void sendRawCommand (String cmd)
void setConnectionHandler (ConnectionHandler h)
void setConnectionListeners (Vector l)
void setIn (BufferedReader in)
boolean setLocalPath (String newPath)
Date[] sortDates ()
String[] sortLs ()
String[] sortSize ()
String system ()
boolean type (String code)
int upload (String file, String realName, InputStream in)
int upload (String file, InputStream in)
int upload (String file, String realName)
int upload (String file)

Public Attributes

Vector currentFiles = new Vector()
Vector currentListing = new Vector()
Vector currentPerms = new Vector()
Vector currentSizes = new Vector()
Vector dateVector = new Vector()
boolean hasUploaded = false
boolean work = true

Static Public Attributes

static final String ABOR = "ABOR"
static final String ACCT = "ACCT"
static final String ADAT = "ADAT"
static final String ALLO = "ALLO"
static final String APPE = "APPE"
static final String ASCII = "A"
static final String AUTH = "AUTH"
static final String BINARY = "I"
static final String BLOCKED = "B"
static final String CCC = "CCC"
static final String CDUP = "CDUP"
static final int CHDIR_FAILED = -5
static final String COMPRESSED = "C"
static final String CONF = "CONF"
static final String CWD = "CWD"
static final int DATACONNECTION_FAILED = -12
static final String DELE = "DELE"
static final int DENIED = -666
static final String DOWNLOAD = "DOWNLOAD"
static final String EBCDIC = "E"
static final String ENC = "ENC"
static final int FILE_NOT_FOUND = -11
static final String FTP200_OK = "2"
static final String FTP215_SYSTEM_TYPE = "215"
static final String FTP220_SERVICE_READY = "220"
static final String FTP221_SERVICE_CLOSING = "221"
static final String FTP226_CLOSING_DATA_REQUEST_SUCCESSFUL = "226"
static final String FTP227_ENTERING_PASSIVE_MODE = "227"
static final String FTP230_LOGGED_IN = "2"
static final String FTP250_COMPLETED = "250"
static final String FTP257_PATH_CREATED = "257"
static final String FTP331_USER_OK_NEED_PASSWORD = "331"
static final int GENERIC_FAILED = -8
static final String HELP = "HELP"
static final String L8 = "L 8"
static String LIST = "default"
static String LIST_DEFAULT = "LIST -laL"
static final int LOGIN_OK = 2
static final String MIC = "MIC"
static final String MKD = "MKD"
static final int MKDIR_FAILED = -3
static final String MODE = "MODE"
static final int NEW_TRANSFER_SPAWNED = 0
static final String NLST = "NLST"
static final String NOOP = "NOOP"
static final int OFFLINE = -7
static final String PASS = "PASS"
static final String PASV = "PASV"
static final String PBSZ = "PBSZ"
static final int PERMISSION_DENIED = -4
static final String PORT = "PORT"
static final String PROT = "PROT"
static final String PWD = "PWD"
static final String QUIT = "QUIT"
static final int R = 23
static final String RC110 = "110"
static final String RC120 = "120"
static final String RC125 = "125"
static final String RC150 = "150"
static final String RC202 = "202"
static final String RC211 = "211"
static final String RC212 = "212"
static final String RC213 = "213"
static final String RC214 = "214"
static final String RC225 = "225"
static final String RC332 = "332"
static final String RC350 = "350"
static final String RC421 = "421"
static final String RC425 = "425"
static final String RC426 = "426"
static final String RC450 = "450"
static final String RC451 = "451"
static final String RC452 = "452"
static final String RC500 = "500"
static final String RC501 = "501"
static final String RC502 = "502"
static final String RC503 = "503"
static final String RC504 = "504"
static final String RC530 = "530"
static final String RC532 = "532"
static final String RC550 = "550"
static final String RC551 = "551"
static final String RC552 = "552"
static final String RC553 = "553"
static final String REIN = "REIN"
static final int REMOVE_FAILED = -9
static final int REMOVE_SUCCESSFUL = 3
static final int RENAME_FAILED = -10
static final String REST = "REST"
static final String RETR = "RETR"
static final String RMD = "RMD"
static final String RNFR = "RNFR"
static final String RNTO = "RNTO"
static final String SITE = "SITE"
static final String SMNT = "SMNT"
static final String STAT = "STAT"
static final String STOR = "STOR"
static final String STOU = "STOU"
static final String STREAM = "S"
static final String STRU = "STRU"
static final String SYST = "SYST"
static final int TRANSFER_FAILED = -1
static final int TRANSFER_STOPPED = -2
static final int TRANSFER_SUCCESSFUL = 1
static final String TYPE = "TYPE"
static final String UPLOAD = "UPLOAD"
static final String USER = "USER"
static final int W = 42
static final int WRONG_LOGIN_DATA = -6

Private Member Functions

boolean chdirWork (String p)
int cleanDir (String dir, String path)
int downloadDir (String dir)
int getActivePort ()
String getActivePortCmd () throws UnknownHostException, IOException
int getPasvPort (String str)
int getPortA ()
int getPortB ()
String giveFile (StringTokenizer to, int lev)
String giveSize (StringTokenizer to, int lev)
void incrementPort ()
boolean isSymlink (String file)
int negotiatePort () throws IOException
String parse (String file)
String parseSymlink (String file)
String parseSymlinkBack (String file)
int rawDownload (String file)
int rawUpload (String file, String realName, InputStream in)
int rawUpload (String file, String realName)
int rawUpload (String file)
void setOsType (String os)
boolean success (String op)
String[] toArray (Vector in)
void updatePWD ()
int uploadDir (String dir)

Private Attributes

String baseFile
boolean connected = false
String crlf = null
String dataType
DataConnection dcon = null
int fileCount
ConnectionHandler handler = new ConnectionHandler()
String host = ""
BufferedReader in
String initCWD = Settings.defaultDir
boolean isDirUpload = false
JConnection jcon
FtpTransfer lastTransfer = null
Vector listeners = new Vector()
String localPath = null
String[] loginAck
boolean modeStreamSet = false
boolean msg = true
boolean ok = true
String osType = ""
String password
int port = 21
String pwd = ""
boolean shortProgress = false
String typeNow = ""
String username

Static Private Attributes

static final char MORE_LINES_APPENDED = '-'
static final String NEGATIVE = "5"
static final String NEGATIVE2 = "4"
static int porta = 5
static int portb = 1
static final String POSITIVE = "2"
static final String PROCEED = "3"
static final boolean TESTMODE = false
static boolean useBlocked = true
static boolean useCompressed = true
static boolean useStream = true

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index