| java.lang.Object com.enterprisedt.net.ftp.FTPControlSocket
FTPControlSocket | public class FTPControlSocket (Code) | | Supports client-side FTP operations
author: Bruce Blackshaw version: $Revision: 1.1.1.1 $ |
CONTROL_PORT | final static int CONTROL_PORT(Code) | | The control port number for FTP
|
EOL | final static String EOL(Code) | | Standard FTP end of line sequence
|
FTPControlSocket | public FTPControlSocket(String remoteHost, int controlPort, PrintWriter log, int timeout) throws IOException, FTPException(Code) | | Constructor. Performs TCP connection and
sets up reader/writer. Allows different control
port to be used
Parameters: remoteHost - Remote hostname Parameters: controlPort - port for control stream Parameters: millis - the length of the timeout, in milliseconds Parameters: log - the new logging stream |
FTPControlSocket | public FTPControlSocket(InetAddress remoteAddr, int controlPort, PrintWriter log, int timeout) throws IOException, FTPException(Code) | | Constructor. Performs TCP connection and
sets up reader/writer. Allows different control
port to be used
Parameters: remoteAddr - Remote inet address Parameters: controlPort - port for control stream Parameters: millis - the length of the timeout, in milliseconds Parameters: log - the new logging stream |
createDataSocket | FTPDataSocket createDataSocket(FTPConnectMode connectMode) throws IOException, FTPException(Code) | | Request a data socket be created on the
server, connect to it and return our
connected socket.
Parameters: active - if true, create in active mode, elsein passive mode connected data socket |
createDataSocketActive | ServerSocket createDataSocketActive() throws IOException, FTPException(Code) | | Request a data socket be created on the Client
client on any free port, do not connect it to yet.
not connected data socket |
createDataSocketPASV | Socket createDataSocketPASV() throws IOException, FTPException(Code) | | Request a data socket be created on the
server, connect to it and return our
connected socket.
connected data socket |
debugResponses | void debugResponses(boolean on)(Code) | | Switch debug of responses on or off
Parameters: on - true if you wish to have responses tostdout, false otherwise |
getRemoteHostName | String getRemoteHostName()(Code) | | Get the name of the remote host
remote host name |
log | void log(String msg)(Code) | | Log a message, if logging is set up
Parameters: msg - message to log |
logout | public void logout() throws IOException(Code) | | Quit this FTP session and clean up.
|
readReply | String readReply() throws IOException(Code) | | 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.
reply string |
sendCommand | String sendCommand(String command) throws IOException(Code) | | Send a command to the FTP server and
return the server's reply
reply to the supplied command |
setLogStream | void setLogStream(PrintWriter log)(Code) | | Set the logging stream, replacing
stdout. If null log supplied, logging is
switched off
Parameters: log - the new logging stream |
setTimeout | void setTimeout(int millis) throws IOException(Code) | | 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.
Parameters: millis - The length of the timeout, in milliseconds |
toByteArray | protected byte[] toByteArray(short value)(Code) | | Convert a short into a byte array
Parameters: value - value to convert a byte array |
validateReply | FTPReply validateReply(String reply, String expectedReplyCode) throws IOException, FTPException(Code) | | 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
Parameters: reply - the entire reply string we received Parameters: expectedReplyCode - the reply we expected to receive |
validateReply | FTPReply validateReply(String reply, String[] expectedReplyCodes) throws IOException, FTPException(Code) | | 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
Parameters: reply - the entire reply string we received Parameters: expectedReplyCodes - array of expected replies an object encapsulating the server's reply |
|
|