Package org.apache.commons.net.ftp

# Class FTPSSocketFactory

java.lang.Object
javax.net.SocketFactory
org.apache.commons.net.ftp.FTPSSocketFactory

public class FTPSSocketFactory extends SocketFactory
Socket factory for FTPS connections.

Since:
  2.0

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `FTPSSocketFactory(SSLContext context)`
  Constructs a new instance.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `ServerSocket`
  `createServerSocket(int port)`
  Deprecated.
  (2.2) use `FTPSServerSocketFactory.createServerSocket(int)`.
  `ServerSocket`
  `createServerSocket(int port, int backlog)`
  Deprecated.
  (2.2) use `FTPSServerSocketFactory.createServerSocket(int, int)`.
  `ServerSocket`
  `createServerSocket(int port, int backlog, InetAddress ifAddress)`
  Deprecated.
  (2.2) use `FTPSServerSocketFactory.createServerSocket(int, int, InetAddress)`.
  `Socket`
  `createSocket()`
  `Socket`
  `createSocket(String address, int port)`
  `Socket`
  `createSocket(String address, int port, InetAddress localAddress, int localPort)`
  `Socket`
  `createSocket(InetAddress address, int port)`
  `Socket`
  `createSocket(InetAddress address, int port, InetAddress localAddress, int localPort)`
  `ServerSocket`
  `init(ServerSocket socket)`
  Deprecated.
  (2.2) use `FTPSServerSocketFactory.init(java.net.ServerSocket)`

  ### Methods inherited from class javax.net.SocketFactory

  `getDefault`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### FTPSSocketFactory

    public FTPSSocketFactory(SSLContext context)
    Constructs a new instance.
    Parameters:
      `context` - The SSL context.

- ## Method Details

  - ### createServerSocket

    @Deprecated public ServerSocket createServerSocket(int port) throws IOException
    Deprecated.
    (2.2) use `FTPSServerSocketFactory.createServerSocket(int)`.
    Parameters:
      `port` - the port
    Returns:
      the socket
    Throws:
      `IOException` - on error

  - ### createServerSocket

    @Deprecated public ServerSocket createServerSocket(int port, int backlog) throws IOException
    Deprecated.
    (2.2) use `FTPSServerSocketFactory.createServerSocket(int, int)`.
    Parameters:
      `port` - the port
      `backlog` - the backlog
    Returns:
      the socket
    Throws:
      `IOException` - on error

  - ### createServerSocket

    @Deprecated public ServerSocket createServerSocket(int port, int backlog, InetAddress ifAddress) throws IOException
    Deprecated.
    (2.2) use `FTPSServerSocketFactory.createServerSocket(int, int, InetAddress)`.
    Parameters:
      `port` - the port
      `backlog` - the backlog
      `ifAddress` - the interface
    Returns:
      the socket
    Throws:
      `IOException` - on error

  - ### createSocket

    public Socket createSocket() throws IOException
    Overrides:
      `createSocket` in class `SocketFactory`
    Throws:
      `IOException`

  - ### createSocket

    public Socket createSocket(InetAddress address, int port) throws IOException
    Specified by:
      `createSocket` in class `SocketFactory`
    Throws:
      `IOException`

  - ### createSocket

    public Socket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort) throws IOException
    Specified by:
      `createSocket` in class `SocketFactory`
    Throws:
      `IOException`

  - ### createSocket

    public Socket createSocket(String address, int port) throws UnknownHostException, IOException
    Specified by:
      `createSocket` in class `SocketFactory`
    Throws:
      `UnknownHostException`
      `IOException`

  - ### createSocket

    public Socket createSocket(String address, int port, InetAddress localAddress, int localPort) throws UnknownHostException, IOException
    Specified by:
      `createSocket` in class `SocketFactory`
    Throws:
      `UnknownHostException`
      `IOException`

  - ### init

    @Deprecated public ServerSocket init(ServerSocket socket) throws IOException
    Deprecated.
    (2.2) use `FTPSServerSocketFactory.init(java.net.ServerSocket)`
    Parameters:
      `socket` - the socket
    Returns:
      the socket
    Throws:
      `IOException` - on error