public class FTPCommunicationChannel
extends java.lang.Object
| Constructor and Description |
|---|
FTPCommunicationChannel(java.net.Socket connection,
java.lang.String charsetName)
It builds a FTP communication channel.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCommunicationListener(FTPCommunicationListener listener)
This method adds a FTPCommunicationListener to the object.
|
void |
changeCharset(java.lang.String charsetName)
Changes the current charset.
|
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.
|
void |
ssl(javax.net.ssl.SSLSocketFactory sslSocketFactory)
Applies SSL encryption to the communication channel.
|
public FTPCommunicationChannel(java.net.Socket connection,
java.lang.String charsetName)
throws java.io.IOException
connection - The underlying connection.charsetName - The name of the charset that has to be used to encode and
decode the communication.java.io.IOException - If a I/O error occurs.public void addCommunicationListener(FTPCommunicationListener listener)
listener - The listener.public void removeCommunicationListener(FTPCommunicationListener listener)
listener - The listener to be removed.public void close()
public FTPCommunicationListener[] getCommunicationListeners()
public void sendFTPCommand(java.lang.String command)
throws java.io.IOException
command - The command to be sent.java.io.IOException - If an I/O error occurs.public FTPReply readFTPReply() throws java.io.IOException, FTPIllegalReplyException
java.io.IOException - If an I/O error occurs.FTPIllegalReplyException - If the server doesn't reply in a FTP-compliant way.public void changeCharset(java.lang.String charsetName)
throws java.io.IOException
charsetName - The new charset.java.io.IOException - If I/O error occurs.public void ssl(javax.net.ssl.SSLSocketFactory sslSocketFactory)
throws java.io.IOException
sslSocketFactory - The SSLSocketFactory used to produce the SSL connection.java.io.IOException - If a I/O error occurs.