it.sauronsoftware.ftp4j.connectors
Class SOCKS5Connector

java.lang.Object
  extended by it.sauronsoftware.ftp4j.connectors.SOCKS5Connector
All Implemented Interfaces:
FTPConnector

public class SOCKS5Connector
extends java.lang.Object
implements FTPConnector

This one connects a remote ftp host through a SOCKS5 proxy server.

Author:
Carlo Pelliccia

Constructor Summary
SOCKS5Connector(java.lang.String socks5host, int socks5port)
          It builds the connector.
SOCKS5Connector(java.lang.String socks5host, int socks5port, java.lang.String socks5user, java.lang.String socks5pass)
          It builds the connector.
 
Method Summary
 FTPConnection connectForCommunicationChannel(java.lang.String host, int port)
          This methods returns an established connection to a remote host, suitable for a FTP communication channel.
 FTPConnection 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SOCKS5Connector

public SOCKS5Connector(java.lang.String socks5host,
                       int socks5port,
                       java.lang.String socks5user,
                       java.lang.String socks5pass)
It builds the connector.

Parameters:
socks5host - The socks5 proxy host name.
socks5port - The socks5 proxy port.
socks5user - The socks5 proxy user (optional, can be set to null).
socks5pass - The socks5 proxy password (optional, can be set to null if also socks5user is null).

SOCKS5Connector

public SOCKS5Connector(java.lang.String socks5host,
                       int socks5port)
It builds the connector.

Parameters:
socks5host - The socks5 proxy host name.
socks5port - The socks5 proxy port.
Method Detail

connectForCommunicationChannel

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

Specified by:
connectForCommunicationChannel in interface 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 FTPConnection connectForDataTransferChannel(java.lang.String host,
                                                   int port)
                                            throws java.io.IOException
Description copied from interface: FTPConnector
This methods returns an established connection to a remote host, suitable for a FTP data transfer channel.

Specified by:
connectForDataTransferChannel in interface 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.