FTPControlChannel(java.io.InputStream in,
java.io.OutputStream out)
Using this constructor, you can initialize an instance that does not
talk directly to the socket.
execute(Command cmd)
Write the command to the control channel,
block until reply arrives and check if the command
completed successfully (reply code 200).
waitFor(Flag aborted,
int ioDelay,
int maxWait)
Block until one of the conditions are true:
a reply is available in the control channel,
timeout (maxWait) expired
aborted flag changes to true.
void
write(Command cmd)
Sends the command over the control channel.
public FTPControlChannel(java.lang.String host,
int port)
FTPControlChannel
public FTPControlChannel(java.io.InputStream in,
java.io.OutputStream out)
Using this constructor, you can initialize an instance that does not
talk directly to the socket. If you use this constructor using streams
that belong to an active connection, there's no need to call open() afterwards.
public void open()
throws java.io.IOException,
ServerException
opens the connection and returns after it is ready for communication.
Before returning, it intercepts the initial server reply(-ies),
and not positive, throws UnexpectedReplyCodeException.
After returning, there should be no more queued replies on the line.
Here's the sequence for connection establishment (rfc959):
Write the command to the control channel,
block until reply arrives and return the reply.
Before calling this method make sure that no old replies are
waiting on the control channel. Otherwise the reply returned
may not be the reply to this command.
Write the command to the control channel,
block until reply arrives and check if the command
completed successfully (reply code 200).
If so, return the reply, otherwise throw exception.
Before calling this method make sure that no old replies are
waiting on the control channel. Otherwise the reply returned
may not be the reply to this command.