it.sauronsoftware.ftp4j
Class FTPCommunicationChannel

java.lang.Object
  extended byit.sauronsoftware.ftp4j.FTPCommunicationChannel

public class FTPCommunicationChannel
extends java.lang.Object

This class is used to represent a communication channel with a FTP server.

Author:
Carlo Pelliccia

Constructor Summary
FTPCommunicationChannel(FTPConnection connection)
          It builds a FTP communication channel.
 
Method Summary
 void addCommunicationListener(FTPCommunicationListener listener)
          This method adds a FTPCommunicationListener to the object.
 void close()
          Closes the channel.
 FTPCommunicationListener[] getCommunicationListeners()
          This method returns a list with all the FTPCommunicationListener used by the client.
 FTPReply readFTPReply()
          This method reads and parses a FTP reply statement from the server.
 void removeCommunicationListener(FTPCommunicationListener listener)
          This method removes a FTPCommunicationListener previously added to the object.
 void sendFTPCommand(java.lang.String command)
          This method sends a command line to the server.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FTPCommunicationChannel

public FTPCommunicationChannel(FTPConnection connection)
                        throws java.io.IOException
It builds a FTP communication channel.

Parameters:
connection - The underlying connection.
Throws:
java.io.IOException - If a I/O error occurs.
Method Detail

addCommunicationListener

public void addCommunicationListener(FTPCommunicationListener listener)
This method adds a FTPCommunicationListener to the object.

Parameters:
listener - The listener.

removeCommunicationListener

public void removeCommunicationListener(FTPCommunicationListener listener)
This method removes a FTPCommunicationListener previously added to the object.

Parameters:
listener - The listener to be removed.

close

public void close()
Closes the channel.


getCommunicationListeners

public FTPCommunicationListener[] getCommunicationListeners()
This method returns a list with all the FTPCommunicationListener used by the client.

Returns:
A list with all the FTPCommunicationListener used by the client.

sendFTPCommand

public void sendFTPCommand(java.lang.String command)
                    throws java.io.IOException
This method sends a command line to the server.

Parameters:
command - The command to be sent.
Throws:
java.io.IOException - If an I/O error occurs.

readFTPReply

public FTPReply readFTPReply()
                      throws java.io.IOException,
                             FTPIllegalReplyException
This method reads and parses a FTP reply statement from the server.

Returns:
The reply fron the server.
Throws:
java.io.IOException - If an I/O error occurs.
FTPIllegalReplyException - If the server doesn't reply in a FTP-compliant way.