Save This Page
Home » edtftpj » com.enterprisedt.net.ftp » [javadoc | source]
com.enterprisedt.net.ftp
public class: FTPControlSocket [javadoc | source]
java.lang.Object
   com.enterprisedt.net.ftp.FTPControlSocket
Supports client-side FTP operations
Field Summary
static final  String EOL    Standard FTP end of line sequence 
Constructor:
 public FTPControlSocket(String remoteHost) throws IOException, FTPException 
    Constructor. Performs TCP connection and sets up reader/writer
    Parameters:
    remoteHost - Remote hostname
 public FTPControlSocket(InetAddress remoteAddr) throws IOException, FTPException 
    Constructor. Performs TCP connection and sets up reader/writer
    Parameters:
    remoteAddr - Remote inet address
 public FTPControlSocket(String remoteHost,
    int controlPort) throws IOException, FTPException 
    Constructor. Performs TCP connection and sets up reader/writer. Allows different control port to be used
    Parameters:
    remoteHost - Remote hostname
    controlPort - port for control stream
 public FTPControlSocket(InetAddress remoteAddr,
    int controlPort) throws IOException, FTPException 
    Constructor. Performs TCP connection and sets up reader/writer. Allows different control port to be used
    Parameters:
    remoteAddr - Remote inet address
    controlPort - port for control stream
Method from com.enterprisedt.net.ftp.FTPControlSocket Summary:
createDataSocket,   createDataSocketActive,   createDataSocketPASV,   debugResponses,   getRemoteHostName,   logout,   readReply,   sendCommand,   setTimeout,   toByteArray,   validateReply,   validateReply
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from com.enterprisedt.net.ftp.FTPControlSocket Detail:
 FTPDataSocket createDataSocket(FTPConnectMode connectMode) throws IOException, FTPException 
    Request a data socket be created on the server, connect to it and return our connected socket.
 ServerSocket createDataSocketActive() throws IOException, FTPException 
    Request a data socket be created on the Client client on any free port, do not connect it to yet.
 Socket createDataSocketPASV() throws IOException, FTPException 
    Request a data socket be created on the server, connect to it and return our connected socket.
  void debugResponses(boolean on) 
    Switch debug of responses on or off
 String getRemoteHostName() 
    Get the name of the remote host
 public  void logout() throws IOException 
    Quit this FTP session and clean up.
 String readReply() throws IOException 
    Read the FTP server's reply to a previously issued command. RFC 959 states that a reply consists of the 3 digit code followed by text. The 3 digit code is followed by a hyphen if it is a muliline response, and the last line starts with the same 3 digit code.
 String sendCommand(String command) throws IOException 
    Send a command to the FTP server and return the server's reply
  void setTimeout(int millis) throws IOException 
    Set the TCP timeout on the underlying control socket. If a timeout is set, then any operation which takes longer than the timeout value will be killed with a java.io.InterruptedException.
 protected byte[] toByteArray(short value) 
    Convert a short into a byte array
  void validateReply(String reply,
    String expectedReplyCode) throws IOException, FTPException 
    Validate the response the host has supplied against the expected reply. If we get an unexpected reply we throw an exception, setting the message to that returned by the FTP server
  void validateReply(String reply,
    String[] expectedReplyCodes) throws IOException, FTPException 
    Validate the response the host has supplied against the expected reply. If we get an unexpected reply we throw an exception, setting the message to that returned by the FTP server