Class FtpHttpProxySessionFactory

java.lang.Object
org.springframework.integration.ftp.session.AbstractFtpSessionFactory<org.apache.commons.net.ftp.FTPHTTPClient>
org.springframework.integration.ftp.session.FtpHttpProxySessionFactory
All Implemented Interfaces:
SessionFactory<org.apache.commons.net.ftp.FTPFile>

public class FtpHttpProxySessionFactory extends AbstractFtpSessionFactory<org.apache.commons.net.ftp.FTPHTTPClient>
An AbstractFtpSessionFactory for the connections tunneled through an HTTP proxy with the CONNECT method, based on the FTPHTTPClient.

Unlike the setProxy(Proxy) option of the other factories, this factory sends the credentials of the proxy, when they are provided, with the basic authentication scheme.

Both the control connection and the data connections are tunneled through the proxy, therefore only the FTPClient.PASSIVE_LOCAL_DATA_CONNECTION_MODE is supported, and it is the default client mode of this factory.

Since:
7.2
Author:
Sharang Gupta
  • Constructor Details

    • FtpHttpProxySessionFactory

      public FtpHttpProxySessionFactory()
  • Method Details

    • setProxyHost

      public void setProxyHost(String proxyHost)
      Set the host of the HTTP proxy.
      Parameters:
      proxyHost - the host of the proxy.
    • setProxyPort

      public void setProxyPort(int proxyPort)
      Set the port of the HTTP proxy.
      Parameters:
      proxyPort - the port of the proxy.
    • setProxyUsername

      public void setProxyUsername(String proxyUsername)
      Set the username for the HTTP proxy, when the proxy requires authentication. The password is required as well.
      Parameters:
      proxyUsername - the username for the proxy.
    • setProxyPassword

      public void setProxyPassword(String proxyPassword)
      Set the password for the HTTP proxy, when the proxy requires authentication.
      Parameters:
      proxyPassword - the password for the proxy.
    • setClientMode

      public void setClientMode(int clientMode)
      Only the FTPClient.PASSIVE_LOCAL_DATA_CONNECTION_MODE is supported through an HTTP proxy.
      Overrides:
      setClientMode in class AbstractFtpSessionFactory<org.apache.commons.net.ftp.FTPHTTPClient>
      Parameters:
      clientMode - the client mode.
    • setProxy

      public void setProxy(Proxy proxy)
      This factory connects to the HTTP proxy directly, so an additional proxy is not supported.
      Overrides:
      setProxy in class AbstractFtpSessionFactory<org.apache.commons.net.ftp.FTPHTTPClient>
      Parameters:
      proxy - the proxy.
      See Also:
      • SocketClient.setProxy(Proxy)
    • createClientInstance

      protected org.apache.commons.net.ftp.FTPHTTPClient createClientInstance()
      Specified by:
      createClientInstance in class AbstractFtpSessionFactory<org.apache.commons.net.ftp.FTPHTTPClient>