it.sauronsoftware.ftp4j.connectors
Class SOCKS4Connector

java.lang.Object
  extended by it.sauronsoftware.ftp4j.FTPConnector
      extended by it.sauronsoftware.ftp4j.connectors.SOCKS4Connector

public class SOCKS4Connector
extends FTPConnector

This one connects a remote ftp host through a SOCKS4/4a proxy server. The connector's default value for the useSuggestedAddressForDataConnections flag is false.

Author:
Carlo Pelliccia

Field Summary
 
Fields inherited from class it.sauronsoftware.ftp4j.FTPConnector
closeTimeout, connectionTimeout, readTimeout
 
Constructor Summary
SOCKS4Connector(java.lang.String socks4host, int socks4port)
          It builds the connector.
SOCKS4Connector(java.lang.String socks4host, int socks4port, java.lang.String socks4user)
          It builds the connector.
 
Method Summary
 java.net.Socket connectForCommunicationChannel(java.lang.String host, int port)
          This methods returns an established connection to a remote host, suitable for a FTP communication channel.
 java.net.Socket connectForDataTransferChannel(java.lang.String host, int port)
          This methods returns an established connection to a remote host, suitable for a FTP data transfer channel.
 
Methods inherited from class it.sauronsoftware.ftp4j.FTPConnector
abortConnectForCommunicationChannel, setCloseTimeout, setConnectionTimeout, setReadTimeout, setUseSuggestedAddressForDataConnections, tcpConnectForCommunicationChannel, tcpConnectForDataTransferChannel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SOCKS4Connector

public SOCKS4Connector(java.lang.String socks4host,
                       int socks4port,
                       java.lang.String socks4user)
It builds the connector.

Parameters:
socks4host - The socks4 proxy host name.
socks4port - The socks4 proxy port.
socks4user - The socks4 proxy user (optional, can be set to null).

SOCKS4Connector

public SOCKS4Connector(java.lang.String socks4host,
                       int socks4port)
It builds the connector.

Parameters:
socks4host - The socks4 proxy host name.
socks4port - The socks4 proxy port.
Method Detail

connectForCommunicationChannel

public java.net.Socket connectForCommunicationChannel(java.lang.String host,
                                                      int port)
                                               throws java.io.IOException
Description copied from class: FTPConnector
This methods returns an established connection to a remote host, suitable for a FTP communication channel.

Specified by:
connectForCommunicationChannel in class FTPConnector
Parameters:
host - The remote host name or address.
port - The remote port.
Returns:
The connection with the remote host.
Throws:
java.io.IOException - If the connection cannot be established.

connectForDataTransferChannel

public java.net.Socket connectForDataTransferChannel(java.lang.String host,
                                                     int port)
                                              throws java.io.IOException
Description copied from class: FTPConnector
This methods returns an established connection to a remote host, suitable for a FTP data transfer channel.

Specified by:
connectForDataTransferChannel in class FTPConnector
Parameters:
host - The remote host name or address.
port - The remote port.
Returns:
The connection with the remote host.
Throws:
java.io.IOException - If the connection cannot be established.