Class FTPPoolConfig.Builder

  • Enclosing class:
    FTPPoolConfig

    public static final class FTPPoolConfig.Builder
    extends Object
    A builder for FTPPoolConfig objects.
    Author:
    Rob Spoor
    Since:
    3.0
    • Method Detail

      • withMaxWaitTime

        public FTPPoolConfig.Builder withMaxWaitTime​(Duration maxWaitTime)
        Sets the maximum time to wait when acquiring client connections. If null or negative, acquiring client connections should block until a connection is available. The default is to wait indefinitely.
        Parameters:
        maxWaitTime - The maximum wait time.
        Returns:
        This builder.
      • withMaxIdleTime

        public FTPPoolConfig.Builder withMaxIdleTime​(Duration maxIdleTime)
        Sets the maximum time that client connections can be idle. The default is indefinitely.
        Parameters:
        maxIdleTime - The maximum idle time, or null if client connections can be idle indefinitely.
        Returns:
        This builder.
      • withInitialSize

        public FTPPoolConfig.Builder withInitialSize​(int initialSize)
        Sets the initial pool size. This is the number of idle client connections to start with. The default is 1.

        If the maximum pool size is smaller than the given initial size, it will be set to be equal to the given initial size.

        Parameters:
        initialSize - The initial pool size.
        Returns:
        This builder.
        Throws:
        IllegalArgumentException - If the initial size is negative.
      • withMaxSize

        public FTPPoolConfig.Builder withMaxSize​(int maxSize)
        Sets the maximum pool size. This is the maximum number of client connections, both idle and currently in use. The default is 5.

        If the initial pool size is larger than the given maximum size, it will be set to be equal to the given maximum size.

        Parameters:
        maxSize - The maximum pool size.
        Returns:
        This builder.
        Throws:
        IllegalArgumentException - If the given size is not positive.