Class FTPHTTPClient

  • All Implemented Interfaces:
    Configurable

    public class FTPHTTPClient
    extends FTPClient
    Experimental attempt at FTP client that tunnels over an HTTP proxy connection.
    Since:
    2.2
    • Constructor Detail

      • FTPHTTPClient

        public FTPHTTPClient​(java.lang.String proxyHost,
                             int proxyPort,
                             java.lang.String proxyUser,
                             java.lang.String proxyPass)
      • FTPHTTPClient

        public FTPHTTPClient​(java.lang.String proxyHost,
                             int proxyPort)
    • Method Detail

      • _openDataConnection_

        @Deprecated
        protected java.net.Socket _openDataConnection_​(int command,
                                                       java.lang.String arg)
                                                throws java.io.IOException
        Deprecated.
        Establishes a data connection with the FTP server, returning a Socket for the connection if successful. If a restart offset has been set with FTPClient.setRestartOffset(long), a REST command is issued to the server with the offset as an argument before establishing the data connection. Active mode connections also cause a local PORT command to be issued.
        Overrides:
        _openDataConnection_ in class FTPClient
        Parameters:
        command - The int representation of the FTP command to send.
        arg - The arguments to the FTP command. If this parameter is set to null, then the command is sent with no argument.
        Returns:
        A Socket corresponding to the established data connection. Null is returned if an FTP protocol error is reported at any point during the establishment and initialization of the connection.
        Throws:
        java.lang.IllegalStateException - if connection mode is not passive
        java.io.IOException - If an I/O error occurs while either sending a command to the server or receiving a reply from the server.
      • _openDataConnection_

        protected java.net.Socket _openDataConnection_​(java.lang.String command,
                                                       java.lang.String arg)
                                                throws java.io.IOException
        Establishes a data connection with the FTP server, returning a Socket for the connection if successful. If a restart offset has been set with FTPClient.setRestartOffset(long), a REST command is issued to the server with the offset as an argument before establishing the data connection. Active mode connections also cause a local PORT command to be issued.
        Overrides:
        _openDataConnection_ in class FTPClient
        Parameters:
        command - The text representation of the FTP command to send.
        arg - The arguments to the FTP command. If this parameter is set to null, then the command is sent with no argument.
        Returns:
        A Socket corresponding to the established data connection. Null is returned if an FTP protocol error is reported at any point during the establishment and initialization of the connection.
        Throws:
        java.lang.IllegalStateException - if connection mode is not passive
        java.io.IOException - If an I/O error occurs while either sending a command to the server or receiving a reply from the server.
        Since:
        3.1
      • connect

        public void connect​(java.lang.String host,
                            int port)
                     throws java.net.SocketException,
                            java.io.IOException
        Description copied from class: SocketClient
        Opens a Socket connected to a remote host at the specified port and originating from the current host at a system assigned port. Before returning, _connectAction_() is called to perform connection initialization actions.

        Overrides:
        connect in class SocketClient
        Parameters:
        host - The name of the remote host.
        port - The port to connect to on the remote host.
        Throws:
        java.net.SocketException - If the socket timeout could not be set.
        java.io.IOException - If the socket could not be opened. In most cases you will only want to catch IOException since SocketException is derived from it.
        java.net.UnknownHostException - If the hostname cannot be resolved.