|
|||||||||||
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 control port number for FTP |
protected java.net.Socket |
controlSock
The underlying socket. |
protected java.io.PrintWriter |
log
Output stream debug is written to, stdout by default |
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,
java.io.PrintWriter log,
int timeout)
Constructs a new FTPControlSocket using the given
Socket object. |
Method Summary | |
protected void |
closeLogStream()
Close the log stream |
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. |
java.lang.String |
sendCommand(java.lang.String command)
Send a command to the FTP server and return the server's reply |
protected byte[] |
toByteArray(short value)
Convert a short into a byte array |
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 final int CONTROL_PORT
protected java.io.PrintWriter log
protected java.net.Socket controlSock
protected java.io.Writer writer
protected java.io.BufferedReader reader
Constructor Detail |
protected FTPControlSocket(java.net.Socket controlSock, java.io.PrintWriter log, int timeout) throws java.io.IOException, FTPException
FTPControlSocket
using the given
Socket
object.
controlSock
- Socket to be used.log
- Logging writer to be used.timeout
- Timeout to be used.
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 void closeLogStream()
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 java.lang.String sendCommand(java.lang.String command) throws java.io.IOException
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
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |