Class Http4FileSystemConfigBuilder


  • public class Http4FileSystemConfigBuilder
    extends FileSystemConfigBuilder
    Configuration options builder utility for http4 provider.
    Since:
    2.3
    • Field Detail

      • MAX_TOTAL_CONNECTIONS

        private static final java.lang.String MAX_TOTAL_CONNECTIONS
        Defines the maximum number of connections allowed overall. This value only applies to the number of connections from a particular instance of HTTP connection manager.

        This parameter expects a value of type Integer.

        See Also:
        Constant Field Values
      • MAX_HOST_CONNECTIONS

        private static final java.lang.String MAX_HOST_CONNECTIONS
        Defines the maximum number of connections allowed per host configuration. These values only apply to the number of connections from a particular instance of HTTP connection manager.
        See Also:
        Constant Field Values
      • CONNECTION_TIMEOUT

        private static final java.lang.String CONNECTION_TIMEOUT
        Defines the connection timeout of an HTTP request.

        This parameter expects a value of type Integer.

        See Also:
        Constant Field Values
      • SO_TIMEOUT

        private static final java.lang.String SO_TIMEOUT
        Defines the socket timeout of an HTTP request.

        This parameter expects a value of type Integer.

        See Also:
        Constant Field Values
      • KEEP_ALIVE

        private static final java.lang.String KEEP_ALIVE
        Defines whether Keep-Alive option is used or not.

        This parameter expects a value of type Boolean.

        See Also:
        Constant Field Values
      • KEYSTORE_FILE

        private static final java.lang.String KEYSTORE_FILE
        Defines the keystore file path for SSL connections.

        This parameter expects a value of type String.

        See Also:
        Constant Field Values
      • KEYSTORE_PASS

        private static final java.lang.String KEYSTORE_PASS
        Defines the keystore pass phrase for SSL connections.

        This parameter expects a value of type String.

        See Also:
        Constant Field Values
      • KEYSTORE_TYPE

        private static final java.lang.String KEYSTORE_TYPE
        Defines the keystore type for the underlying HttpClient.
        See Also:
        Constant Field Values
      • HOSTNAME_VERIFICATION_ENABLED

        private static final java.lang.String HOSTNAME_VERIFICATION_ENABLED
        Defines whether the host name should be verified or not in SSL connections.

        This parameter expects a value of type Boolean.

        See Also:
        Constant Field Values
      • KEY_FOLLOW_REDIRECT

        protected static final java.lang.String KEY_FOLLOW_REDIRECT
        Defines whether the HttpClient should follow redirections from the responses.

        This parameter expects a value of type Boolean.

        See Also:
        Constant Field Values
      • KEY_USER_AGENT

        private static final java.lang.String KEY_USER_AGENT
        Defines the User-Agent request header string of the underlying HttpClient.

        This parameter expects a value of type String.

        See Also:
        Constant Field Values
      • KEY_PREEMPTIVE_AUTHENTICATION

        private static final java.lang.String KEY_PREEMPTIVE_AUTHENTICATION
        Defines whether the preemptive authentication should be enabled or not.

        This parameter expects a value of type Boolean.

        See Also:
        Constant Field Values
      • DEFAULT_CONNECTION_TIMEOUT

        private static final java.time.Duration DEFAULT_CONNECTION_TIMEOUT
        The default value for CONNECTION_TIMEOUT configuration.
      • DEFAULT_SO_TIMEOUT

        private static final java.time.Duration DEFAULT_SO_TIMEOUT
        The default value for SO_TIMEOUT configuration.
      • PROXY_SCHEME

        private static final java.lang.String PROXY_SCHEME
        Defines http scheme for proxy host

        This parameter expects a value of type String.

        See Also:
        Constant Field Values
    • Constructor Detail

      • Http4FileSystemConfigBuilder

        private Http4FileSystemConfigBuilder()
      • Http4FileSystemConfigBuilder

        protected Http4FileSystemConfigBuilder​(java.lang.String prefix)
        Construct an Http4FileSystemConfigBuilder.
        Parameters:
        prefix - String for properties of this file system.
    • Method Detail

      • getConnectionTimeoutDuration

        public java.time.Duration getConnectionTimeoutDuration​(FileSystemOptions opts)
        /** Gets the connection timeout.
        Parameters:
        opts - The FileSystem options.
        Returns:
        The connection timeout.
        Since:
        2.8.0
      • getCookies

        public org.apache.http.cookie.Cookie[] getCookies​(FileSystemOptions opts)
        Gets the cookies to add to the request.
        Parameters:
        opts - The FileSystem options.
        Returns:
        the Cookie array.
      • getKeyStoreFile

        public java.lang.String getKeyStoreFile​(FileSystemOptions opts)
        Return keystore file path to be used in SSL connections.
        Parameters:
        opts - the file system options to modify
        Returns:
        keystore file path to be used in SSL connections
      • getKeyStorePass

        java.lang.String getKeyStorePass​(FileSystemOptions opts)
        Return keystore pass phrase for SSL connections.
        Parameters:
        opts - the file system options to modify
        Returns:
        keystore pass phrase for SSL connections
      • getKeyStoreType

        public java.lang.String getKeyStoreType​(FileSystemOptions opts)
        Get keystore type for SSL connections.
        Parameters:
        opts - the file system options to modify
        Returns:
        keystore type for SSL connections
        Since:
        2.7.0
      • getMaxConnectionsPerHost

        public int getMaxConnectionsPerHost​(FileSystemOptions opts)
        Gets the maximum number of connections allowed per host.
        Parameters:
        opts - The FileSystemOptions.
        Returns:
        The maximum number of connections allowed per host.
      • getMaxTotalConnections

        public int getMaxTotalConnections​(FileSystemOptions opts)
        Gets the maximum number of connections allowed.
        Parameters:
        opts - The FileSystemOptions.
        Returns:
        The maximum number of connections allowed.
      • getProxyAuthenticator

        public UserAuthenticator getProxyAuthenticator​(FileSystemOptions opts)
        Gets the proxy authenticator where the system should get the credentials from.
        Parameters:
        opts - The FileSystem options.
        Returns:
        The UserAuthenticator.
      • getSoTimeoutDuration

        public java.time.Duration getSoTimeoutDuration​(FileSystemOptions opts)
        Gets the socket timeout.
        Parameters:
        opts - The FileSystemOptions.
        Returns:
        The socket timeout.
        Since:
        2.8.0
      • getUrlCharset

        public java.lang.String getUrlCharset​(FileSystemOptions opts)
        Sets the charset used for url encoding.
        Parameters:
        opts - The FileSystem options.
        Returns:
        the charset name.
      • getUserAgent

        public java.lang.String getUserAgent​(FileSystemOptions opts)
        Gets the user agent string
        Parameters:
        opts - the file system options to modify
        Returns:
        User provided User-Agent string, otherwise default of: Commons-VFS
      • isHostnameVerificationEnabled

        public boolean isHostnameVerificationEnabled​(FileSystemOptions opts)
        Determines if the hostname should be verified in SSL context.
        Parameters:
        opts - The FileSystemOptions.
        Returns:
        true if if the FileSystemOptions indicate that HTTP Keep-Alive is respected.
      • isKeepAlive

        public boolean isKeepAlive​(FileSystemOptions opts)
        Determines if the FileSystemOptions indicate that HTTP Keep-Alive is respected.
        Parameters:
        opts - The FileSystemOptions.
        Returns:
        true if if the FileSystemOptions indicate that HTTP Keep-Alive is respected.
      • isPreemptiveAuth

        public boolean isPreemptiveAuth​(FileSystemOptions opts)
        Determines if the FileSystemOptions indicate that preemptive authentication is requested.
        Parameters:
        opts - The FileSystemOptions.
        Returns:
        true if preemptiveAuth is requested.
      • setConnectionTimeout

        public void setConnectionTimeout​(FileSystemOptions opts,
                                         java.time.Duration connectionTimeout)
        Sets the connection timeout.
        Parameters:
        opts - The FileSystem options.
        connectionTimeout - The connection timeout.
        Since:
        2.8.0
      • setCookies

        public void setCookies​(FileSystemOptions opts,
                               org.apache.http.cookie.Cookie[] cookies)
        The cookies to add to the request.
        Parameters:
        opts - The FileSystem options.
        cookies - An array of Cookies.
      • setHostnameVerificationEnabled

        public void setHostnameVerificationEnabled​(FileSystemOptions opts,
                                                   boolean hostnameVerificationEnabled)
        Sets if the hostname should be verified in SSL context.
        Parameters:
        opts - The FileSystemOptions.
        hostnameVerificationEnabled - whether hostname should be verified
      • setKeepAlive

        public void setKeepAlive​(FileSystemOptions opts,
                                 boolean keepAlive)
        Sets if the FileSystemOptions indicate that HTTP Keep-Alive is respected.
        Parameters:
        opts - The FileSystemOptions.
        keepAlive - whether the FileSystemOptions indicate that HTTP Keep-Alive is respected or not.
      • setKeyStoreFile

        public void setKeyStoreFile​(FileSystemOptions opts,
                                    java.lang.String keyStoreFile)
        Set keystore file path for SSL connections.
        Parameters:
        opts - the file system options to modify
        keyStoreFile - keystore file path
      • setKeyStorePass

        public void setKeyStorePass​(FileSystemOptions opts,
                                    java.lang.String keyStorePass)
        Set keystore pass phrase for SSL connecdtions.
        Parameters:
        opts - the file system options to modify
        keyStorePass - keystore pass phrase for SSL connecdtions
      • setKeyStoreType

        public void setKeyStoreType​(FileSystemOptions opts,
                                    java.lang.String keyStoreType)
        Set keystore type for SSL connections.
        Parameters:
        opts - the file system options to modify
        keyStoreType - keystore type for SSL connections
        Since:
        2.7.0
      • setMaxConnectionsPerHost

        public void setMaxConnectionsPerHost​(FileSystemOptions opts,
                                             int maxHostConnections)
        Sets the maximum number of connections allowed to any host.
        Parameters:
        opts - The FileSystem options.
        maxHostConnections - The maximum number of connections to a host.
      • setMaxTotalConnections

        public void setMaxTotalConnections​(FileSystemOptions opts,
                                           int maxTotalConnections)
        Sets the maximum number of connections allowed.
        Parameters:
        opts - The FileSystem options.
        maxTotalConnections - The maximum number of connections.
      • setPreemptiveAuth

        public void setPreemptiveAuth​(FileSystemOptions opts,
                                      boolean preemptiveAuth)
        Sets the given value for preemptive HTTP authentication (using BASIC) on the given FileSystemOptions object. Defaults to false if not set. It may be appropriate to set to true in cases when the resulting chattiness of the conversation outweighs any architectural desire to use a stronger authentication scheme than basic/preemptive.
        Parameters:
        opts - The FileSystemOptions.
        preemptiveAuth - the desired setting; true=enabled and false=disabled.
      • setProxyAuthenticator

        public void setProxyAuthenticator​(FileSystemOptions opts,
                                          UserAuthenticator authenticator)
        Sets the proxy authenticator where the system should get the credentials from.
        Parameters:
        opts - The FileSystem options.
        authenticator - The UserAuthenticator.
      • setSoTimeout

        public void setSoTimeout​(FileSystemOptions opts,
                                 java.time.Duration soTimeout)
        Sets the socket timeout.
        Parameters:
        opts - The FileSystem options.
        soTimeout - socket timeout.
      • setUrlCharset

        public void setUrlCharset​(FileSystemOptions opts,
                                  java.lang.String charset)
        Sets the charset used for URL encoding.
        Parameters:
        opts - The FileSystem options.
        charset - the charset name.
      • setUserAgent

        public void setUserAgent​(FileSystemOptions opts,
                                 java.lang.String userAgent)
        Sets the user agent to attach to the outgoing http methods
        Parameters:
        opts - the file system options to modify
        userAgent - User Agent String