Class FtpClientFactory.ConnectionFactory<C extends org.apache.commons.net.ftp.FTPClient,B extends FtpFileSystemConfigBuilder>

java.lang.Object
org.apache.commons.vfs2.provider.ftp.FtpClientFactory.ConnectionFactory<C,B>
Type Parameters:
C - The type of FTPClient.
B - The type of FtpFileSystemConfigBuilder
Direct Known Subclasses:
FtpClientFactory.FtpConnectionFactory
Enclosing class:
FtpClientFactory

public abstract static class FtpClientFactory.ConnectionFactory<C extends org.apache.commons.net.ftp.FTPClient,B extends FtpFileSystemConfigBuilder> extends Object
Abstract Factory, used to configure different FTPClients.
  • Field Details

  • Constructor Details

    • ConnectionFactory

      protected ConnectionFactory(B builder)
      Constructs a new instance.
      Parameters:
      builder - How to build.
  • Method Details

    • createClient

      protected abstract C createClient(FileSystemOptions fileSystemOptions) throws FileSystemException
      Creates a new client.
      Parameters:
      fileSystemOptions - the file system options.
      Returns:
      a new client.
      Throws:
      FileSystemException - if a file system error occurs.
    • createConnection

      public C createConnection(String hostname, int port, char[] username, char[] password, String workingDirectory, FileSystemOptions fileSystemOptions) throws FileSystemException
      Creates a connection.
      Parameters:
      hostname - The host name or IP address.
      port - The host port.
      username - The user name.
      password - The user password.
      workingDirectory - The working directory.
      fileSystemOptions - Options to create the connection.
      Returns:
      A new connection.
      Throws:
      FileSystemException - if an error occurs while connecting.
    • setupOpenConnection

      protected abstract void setupOpenConnection(C client, FileSystemOptions fileSystemOptions) throws IOException
      Sets up a new client.
      Parameters:
      client - the client.
      fileSystemOptions - the file system options.
      Throws:
      IOException - if an IO error occurs.