|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.enterprisedt.net.ftp.FTPControlSocket
Supports client-side FTP operations
Field Summary | |
static int |
CONTROL_PORT
The default and standard control port number for FTP |
protected java.net.Socket |
controlSock
The underlying socket. |
static java.lang.String |
cvsId
Revision control id |
protected java.io.BufferedReader |
reader
The reader that reads control data from the control socket |
protected java.io.Writer |
writer
The write that writes to the control socket |
Constructor Summary | |
protected |
FTPControlSocket(java.net.Socket controlSock,
int timeout,
java.lang.String encoding,
FTPMessageListener messageListener)
Constructs a new FTPControlSocket using the given
Socket object. |
Method Summary | |
void |
logout()
Quit this FTP session and clean up. |
protected FTPDataSocket |
newActiveDataSocket(int port)
Constructs a new FTPDataSocket object (server mode) which will
listen on the given port number. |
protected FTPDataSocket |
newPassiveDataSocket(java.lang.String remoteHost,
int port)
Constructs a new FTPDataSocket object (client mode) and connect
to the given remote host and port number. |
FTPReply |
sendCommand(java.lang.String command)
Send a command to the FTP server and return the server's reply as a structured reply object |
protected byte[] |
toByteArray(short value)
Convert a short into a byte array |
FTPReply |
validateReply(FTPReply reply,
java.lang.String expectedReplyCode)
Validate the response the host has supplied against the expected reply. |
FTPReply |
validateReply(FTPReply reply,
java.lang.String[] expectedReplyCodes)
Validate the response the host has supplied against the expected reply. |
FTPReply |
validateReply(java.lang.String reply,
java.lang.String[] expectedReplyCodes)
Validate the response the host has supplied against the expected reply. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static java.lang.String cvsId
public static final int CONTROL_PORT
protected java.net.Socket controlSock
protected java.io.Writer writer
protected java.io.BufferedReader reader
Constructor Detail |
protected FTPControlSocket(java.net.Socket controlSock, int timeout, java.lang.String encoding, FTPMessageListener messageListener) throws java.io.IOException, FTPException
FTPControlSocket
using the given
Socket
object.
controlSock
- Socket to be used.timeout
- Timeout to be used.encoding
- character encoding used for datamessageListener
- listens for messages
java.io.IOException
- Thrown if no connection response could be read from the server.
FTPException
- Thrown if the incorrect connection response was sent by the server.Method Detail |
public void logout() throws java.io.IOException
java.io.IOException
protected byte[] toByteArray(short value)
value
- value to convert
protected FTPDataSocket newPassiveDataSocket(java.lang.String remoteHost, int port) throws java.io.IOException
FTPDataSocket
object (client mode) and connect
to the given remote host and port number.
remoteHost
- Remote host to connect to.port
- Remote port to connect to.
FTPDataSocket
object (client mode) which is
connected to the given server.
java.io.IOException
- Thrown if no TCP/IP connection could be made.protected FTPDataSocket newActiveDataSocket(int port) throws java.io.IOException
FTPDataSocket
object (server mode) which will
listen on the given port number.
port
- Remote port to listen on.
FTPDataSocket
object (server mode) which is
configured to listen on the given port.
java.io.IOException
- Thrown if an error occurred when creating the socket.public FTPReply sendCommand(java.lang.String command) throws java.io.IOException
command
- command to send
java.io.IOException
public FTPReply validateReply(java.lang.String reply, java.lang.String[] expectedReplyCodes) throws java.io.IOException, FTPException
reply
- the entire reply string we receivedexpectedReplyCodes
- array of expected replies
java.io.IOException
FTPException
public FTPReply validateReply(FTPReply reply, java.lang.String[] expectedReplyCodes) throws FTPException
reply
- reply objectexpectedReplyCodes
- array of expected replies
FTPException
public FTPReply validateReply(FTPReply reply, java.lang.String expectedReplyCode) throws FTPException
reply
- reply objectexpectedReplyCode
- expected reply
FTPException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |