com.myjavaworld.ftp
Class SSLDataConnection

java.lang.Object
  extended by com.myjavaworld.ftp.DataConnection
      extended by com.myjavaworld.ftp.SSLDataConnection
All Implemented Interfaces:
FTPConstants

public class SSLDataConnection
extends DataConnection

A DataConnection object is used to transfer data over the data connection in an FTP process. FTPClient object will initiate a DataConnection based on the commands the send to the remote host. For more details about data connection, refer to the FTP protocol specification (RFC 959).


Field Summary
 
Fields inherited from class com.myjavaworld.ftp.DataConnection
abort, client, in, listenerList, out, server, socket
 
Fields inherited from interface com.myjavaworld.ftp.FTPConstants
DEFAULT_BUFFER_SIZE, DEFAULT_IMPLICIT_SSL_PORT, DEFAULT_MODE, DEFAULT_PORT, DEFAULT_STRUCTURE, DEFAULT_TIMEOUT, DEFAULT_TYPE, EOL, MODE_BLOCK, MODE_COMPRESSED, MODE_STREAM, STRUCTURE_FILE, STRUCTURE_PAGE, STRUCTURE_RECORD, TYPE_ASCII, TYPE_BINARY, TYPE_EBCDIC, TYPE_IMAGE, TYPE_LOCAL, USE_EXPLICIT_SSL, USE_IMPLICIT_SSL, USE_NO_SSL, USE_SSL_IF_AVAILABLE
 
Constructor Summary
SSLDataConnection(FTPClient client)
          Constructs a DataConnection object.
 
Method Summary
 void accept()
          Listenes for connections.
 int bind()
          Binds a server socket on the local host on a free port.
 void connect(InetAddress address, int port)
          Connects to the specified InetAddress to the specified port number.
 void connect(String ipAddress, int port)
          Connects to the specified IP address to the specified port number.
 
Methods inherited from class com.myjavaworld.ftp.DataConnection
abort, close, download, fireDataTransferAborted, fireDataTransferFinished, fireDataTransferProgress, fireDataTransferStarted, isAborted, list, stdout, upload
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SSLDataConnection

public SSLDataConnection(FTPClient client)
Constructs a DataConnection object.

Parameters:
client - FTPClient that created this data connection.
Method Detail

bind

public int bind()
         throws ConnectionException
Binds a server socket on the local host on a free port. This server socket is used for transmitting data in active mode.

Overrides:
bind in class DataConnection
Returns:
the port number to which this server is bound to.
Throws:
ConnectionException - If could not bind a server.

accept

public void accept()
            throws ConnectionException
Listenes for connections. This method blocks until a connection is made or a timeout occurs.

Overrides:
accept in class DataConnection
Throws:
ConnectionException - If a network or IO error occurs.

connect

public void connect(String ipAddress,
                    int port)
             throws ConnectionException
Connects to the specified IP address to the specified port number. This method is called by the FTPClients if they prefer to transfer data in passive mode.

Overrides:
connect in class DataConnection
Parameters:
ipAddress - IP address of the remote host in xxx.xxx.xxx.xxx format.
port - Port number to connect to.
Throws:
ConnectionException - if a network or IO error occurs.

connect

public void connect(InetAddress address,
                    int port)
             throws ConnectionException
Connects to the specified InetAddress to the specified port number. This method is called by the FTPClients if they prefer to transfer data in passive mode.

Overrides:
connect in class DataConnection
Parameters:
address - Ineternet address of the remote host.
port - Port number to connect to.
Throws:
ConnectionException - if a network or IO error occurs.


Copyright © 2000-2012 jMethods, Inc.. All Rights Reserved.