javatools.ftp
Interface FTPClient

All Known Implementing Classes:
FTPClientImpl

public interface FTPClient

An FTP client class which implements remote peer-to-peer transfer.


Field Summary
static int DIRECTORY
           
static int FILE
           
static int GETFILE
           
static int GETLIST
           
static int LINK
           
static int UNKNOWN
           
 
Method Summary
 long bytesTransf()
          Gets the number of bytes read
 void cwd(java.lang.String dir)
          Change to the specified directory, which may be relative or absolute.
 void delete(java.lang.String sDirectory, java.lang.String sFile)
          Request to delete the specified file.
 java.util.Vector list()
          Request a listing of the current directory.
 void openConnection(java.lang.String host, java.lang.String user, java.lang.String password)
          Open a connection to a remote host that runs an FTP server.
 void quit()
          Close ftp connection
 void readResponse()
          Read a response from the host.
 void receive(java.lang.String directory, java.lang.String filename, FTPVisitor ftpVisitor)
          Request that the host allocate a port socket and listen for a data connection from another host on that port.
 java.lang.String retResponse()
          Returns FTP server response
 void send(java.lang.String directory, java.lang.String filename, FTPSender ftpSender)
          Request that the host allocate a port socket and listen for a data connection from another host on that port.
 void sendCommand(java.lang.String command)
          Send a command to the host, and read the response.
 void setAscii()
          Set the transfer mode to Ascii.
 void setBinary()
          Set the transfer mode to Image (also referred to as "binary").
 

Field Detail

UNKNOWN

public static final int UNKNOWN
See Also:
Constant Field Values

DIRECTORY

public static final int DIRECTORY
See Also:
Constant Field Values

FILE

public static final int FILE
See Also:
Constant Field Values

LINK

public static final int LINK
See Also:
Constant Field Values

GETLIST

public static final int GETLIST
See Also:
Constant Field Values

GETFILE

public static final int GETFILE
See Also:
Constant Field Values
Method Detail

openConnection

public void openConnection(java.lang.String host,
                           java.lang.String user,
                           java.lang.String password)
                    throws java.io.IOException,
                           java.lang.Exception
Open a connection to a remote host that runs an FTP server.

java.io.IOException
java.lang.Exception

sendCommand

public void sendCommand(java.lang.String command)
                 throws java.io.IOException,
                        java.lang.Exception
Send a command to the host, and read the response.

java.io.IOException
java.lang.Exception

readResponse

public void readResponse()
                  throws java.io.IOException
Read a response from the host.

java.io.IOException

setAscii

public void setAscii()
              throws java.io.IOException,
                     java.lang.Exception
Set the transfer mode to Ascii.

java.io.IOException
java.lang.Exception

setBinary

public void setBinary()
               throws java.io.IOException,
                      java.lang.Exception
Set the transfer mode to Image (also referred to as "binary").

java.io.IOException
java.lang.Exception

cwd

public void cwd(java.lang.String dir)
         throws java.io.IOException,
                java.lang.Exception
Change to the specified directory, which may be relative or absolute.

java.io.IOException
java.lang.Exception

list

public java.util.Vector list()
                      throws java.io.IOException,
                             java.lang.Exception
Request a listing of the current directory. The result is sent on a new data connection.

java.io.IOException
java.lang.Exception

delete

public void delete(java.lang.String sDirectory,
                   java.lang.String sFile)
            throws java.io.IOException,
                   java.lang.Exception
Request to delete the specified file.

java.io.IOException
java.lang.Exception

send

public void send(java.lang.String directory,
                 java.lang.String filename,
                 FTPSender ftpSender)
          throws java.io.IOException,
                 java.lang.Exception
Request that the host allocate a port socket and listen for a data connection from another host on that port. The port that it allocated is returned; this is the port that is to be passed to the send() method.

java.io.IOException
java.lang.Exception

receive

public void receive(java.lang.String directory,
                    java.lang.String filename,
                    FTPVisitor ftpVisitor)
             throws java.io.IOException,
                    java.lang.Exception
Request that the host allocate a port socket and listen for a data connection from another host on that port. The port that it allocated is returned; this is the port that is to be passed to the receive() method.

java.io.IOException
java.lang.Exception

quit

public void quit()
          throws java.io.IOException,
                 java.lang.Exception
Close ftp connection

java.io.IOException
java.lang.Exception

bytesTransf

public long bytesTransf()
Gets the number of bytes read


retResponse

public java.lang.String retResponse()
Returns FTP server response