public class Http4FileSystemConfigBuilder extends FileSystemConfigBuilder
Modifier and Type | Field and Description |
---|---|
private static Http4FileSystemConfigBuilder |
BUILDER |
private static java.lang.String |
CONNECTION_TIMEOUT
Defines the connection timeout of an HTTP request.
|
private static int |
DEFAULT_CONNECTION_TIMEOUT
The default value for
CONNECTION_TIMEOUT configuration. |
private static boolean |
DEFAULT_FOLLOW_REDIRECT
The default value for
KEY_FOLLOW_REDIRECT configuration. |
private static boolean |
DEFAULT_HOSTNAME_VERIFICATION_ENABLED
The default value for
HOSTNAME_VERIFICATION_ENABLED configuration. |
private static boolean |
DEFAULT_KEEP_ALIVE
The default value for
KEEP_ALIVE configuration. |
private static int |
DEFAULT_MAX_CONNECTIONS
The default value for
MAX_TOTAL_CONNECTIONS configuration. |
private static int |
DEFAULT_MAX_HOST_CONNECTIONS
The default value for
MAX_HOST_CONNECTIONS configuration. |
private static int |
DEFAULT_SO_TIMEOUT
The default value for
SO_TIMEOUT configuration. |
private static java.lang.String |
DEFAULT_USER_AGENT
The default value for
KEY_USER_AGENT configuration. |
private static java.lang.String |
HOSTNAME_VERIFICATION_ENABLED
Defines whether the host name should be verified or not in SSL connections.
|
private static java.lang.String |
KEEP_ALIVE
Defines whether Keep-Alive option is used or not.
|
private static java.lang.String |
KEY_FOLLOW_REDIRECT
Defines whether the HttpClient should follow redirections from the responses.
|
private static java.lang.String |
KEY_PREEMPTIVE_AUTHENTICATION
Defines whether the preemptive authentication should be enabled or not.
|
private static java.lang.String |
KEY_USER_AGENT
Defines the User-Agent request header string of the underlying HttpClient.
|
private static java.lang.String |
KEYSTORE_FILE
Defines the keystore file path for SSL connections.
|
private static java.lang.String |
KEYSTORE_PASS
Defines the keystore pass phrase for SSL connections.
|
private static java.lang.String |
MAX_HOST_CONNECTIONS
Defines the maximum number of connections allowed per host configuration.
|
private static java.lang.String |
MAX_TOTAL_CONNECTIONS
Defines the maximum number of connections allowed overall.
|
private static java.lang.String |
SO_TIMEOUT
Defines the socket timeout of an HTTP request.
|
Modifier | Constructor and Description |
---|---|
private |
Http4FileSystemConfigBuilder() |
protected |
Http4FileSystemConfigBuilder(java.lang.String prefix)
Construct an
Http4FileSystemConfigBuilder . |
Modifier and Type | Method and Description |
---|---|
protected java.lang.Class<? extends FileSystem> |
getConfigClass()
Gets the target of this configuration.
|
int |
getConnectionTimeout(FileSystemOptions opts)
Gets the connection timeout.
|
org.apache.http.cookie.Cookie[] |
getCookies(FileSystemOptions opts)
Gets the cookies to add to the request.
|
boolean |
getFollowRedirect(FileSystemOptions opts)
Gets whether to follow redirects for the connection.
|
static Http4FileSystemConfigBuilder |
getInstance()
Gets the singleton builder.
|
java.lang.String |
getKeyStoreFile(FileSystemOptions opts)
Return keystore file path to be used in SSL connections.
|
(package private) java.lang.String |
getKeyStorePass(FileSystemOptions opts)
Return keystore pass phrase for SSL connections.
|
int |
getMaxConnectionsPerHost(FileSystemOptions opts)
Gets the maximum number of connections allowed per host.
|
int |
getMaxTotalConnections(FileSystemOptions opts)
Gets the maximum number of connections allowed.
|
UserAuthenticator |
getProxyAuthenticator(FileSystemOptions opts)
Gets the proxy authenticator where the system should get the credentials from.
|
java.lang.String |
getProxyHost(FileSystemOptions opts)
Gets the proxy to use for http connection.
|
int |
getProxyPort(FileSystemOptions opts)
Gets the proxy-port to use for http the connection.
|
int |
getSoTimeout(FileSystemOptions opts)
Gets the socket timeout.
|
java.lang.String |
getUrlCharset(FileSystemOptions opts)
Sets the charset used for url encoding.
|
java.lang.String |
getUserAgent(FileSystemOptions opts)
Gets the user agent string
|
boolean |
isHostnameVerificationEnabled(FileSystemOptions opts)
Determines if the hostname should be verified in SSL context.
|
boolean |
isKeepAlive(FileSystemOptions opts)
Determines if the FileSystemOptions indicate that HTTP Keep-Alive is respected.
|
boolean |
isPreemptiveAuth(FileSystemOptions opts)
Determines if the FileSystemOptions indicate that preemptive authentication is requested.
|
void |
setConnectionTimeout(FileSystemOptions opts,
int connectionTimeout)
The connection timeout.
|
void |
setCookies(FileSystemOptions opts,
org.apache.http.cookie.Cookie[] cookies)
The cookies to add to the request.
|
void |
setFollowRedirect(FileSystemOptions opts,
boolean redirect)
Sets whether to follow redirects for the connection.
|
void |
setHostnameVerificationEnabled(FileSystemOptions opts,
boolean hostnameVerificationEnabled)
Sets if the hostname should be verified in SSL context.
|
void |
setKeepAlive(FileSystemOptions opts,
boolean keepAlive)
Sets if the FileSystemOptions indicate that HTTP Keep-Alive is respected.
|
void |
setKeyStoreFile(FileSystemOptions opts,
java.lang.String keyStoreFile)
Set keystore file path for SSL connections.
|
void |
setKeyStorePass(FileSystemOptions opts,
java.lang.String keyStorePass)
Set keystore pass phrase for SSL connecdtions.
|
void |
setMaxConnectionsPerHost(FileSystemOptions opts,
int maxHostConnections)
Sets the maximum number of connections allowed to any host.
|
void |
setMaxTotalConnections(FileSystemOptions opts,
int maxTotalConnections)
Sets the maximum number of connections allowed.
|
void |
setPreemptiveAuth(FileSystemOptions opts,
boolean preemptiveAuth)
Sets the given value for preemptive HTTP authentication (using BASIC) on the given FileSystemOptions object.
|
void |
setProxyAuthenticator(FileSystemOptions opts,
UserAuthenticator authenticator)
Sets the proxy authenticator where the system should get the credentials from.
|
void |
setProxyHost(FileSystemOptions opts,
java.lang.String proxyHost)
Sets the proxy to use for http connection.
|
void |
setProxyPort(FileSystemOptions opts,
int proxyPort)
Sets the proxy-port to use for http connection.
|
void |
setSoTimeout(FileSystemOptions opts,
int soTimeout)
The socket timeout.
|
void |
setUrlCharset(FileSystemOptions opts,
java.lang.String chaset)
Sets the charset used for url encoding.
|
void |
setUserAgent(FileSystemOptions opts,
java.lang.String userAgent)
Sets the user agent to attach to the outgoing http methods
|
getBoolean, getBoolean, getBoolean, getByte, getByte, getByte, getCharacter, getCharacter, getCharacter, getDouble, getDouble, getDouble, getEnum, getEnum, getFloat, getFloat, getFloat, getInteger, getInteger, getInteger, getLong, getLong, getLong, getParam, getRootURI, getShort, getShort, getShort, getString, getString, hasObject, hasParam, setParam, setParam, setRootURI
private static final Http4FileSystemConfigBuilder BUILDER
private static final java.lang.String MAX_TOTAL_CONNECTIONS
This parameter expects a value of type Integer
.
private static final java.lang.String MAX_HOST_CONNECTIONS
private static final java.lang.String CONNECTION_TIMEOUT
This parameter expects a value of type Integer
.
private static final java.lang.String SO_TIMEOUT
This parameter expects a value of type Integer
.
private static final java.lang.String KEEP_ALIVE
This parameter expects a value of type Boolean
.
private static final java.lang.String KEYSTORE_FILE
This parameter expects a value of type String
.
private static final java.lang.String KEYSTORE_PASS
This parameter expects a value of type String
.
private static final java.lang.String HOSTNAME_VERIFICATION_ENABLED
This parameter expects a value of type Boolean
.
private static final java.lang.String KEY_FOLLOW_REDIRECT
This parameter expects a value of type Boolean
.
private static final java.lang.String KEY_USER_AGENT
This parameter expects a value of type String
.
private static final java.lang.String KEY_PREEMPTIVE_AUTHENTICATION
This parameter expects a value of type Boolean
.
private static final int DEFAULT_MAX_CONNECTIONS
MAX_TOTAL_CONNECTIONS
configuration.private static final int DEFAULT_MAX_HOST_CONNECTIONS
MAX_HOST_CONNECTIONS
configuration.private static final int DEFAULT_CONNECTION_TIMEOUT
CONNECTION_TIMEOUT
configuration.private static final int DEFAULT_SO_TIMEOUT
SO_TIMEOUT
configuration.private static final boolean DEFAULT_KEEP_ALIVE
KEEP_ALIVE
configuration.private static final boolean DEFAULT_FOLLOW_REDIRECT
KEY_FOLLOW_REDIRECT
configuration.private static final java.lang.String DEFAULT_USER_AGENT
KEY_USER_AGENT
configuration.private static final boolean DEFAULT_HOSTNAME_VERIFICATION_ENABLED
HOSTNAME_VERIFICATION_ENABLED
configuration.protected Http4FileSystemConfigBuilder(java.lang.String prefix)
Http4FileSystemConfigBuilder
.prefix
- String for properties of this file system.private Http4FileSystemConfigBuilder()
public static Http4FileSystemConfigBuilder getInstance()
public void setUrlCharset(FileSystemOptions opts, java.lang.String chaset)
opts
- The FileSystem options.chaset
- the chasetpublic java.lang.String getUrlCharset(FileSystemOptions opts)
opts
- The FileSystem options.public void setProxyHost(FileSystemOptions opts, java.lang.String proxyHost)
You have to set the ProxyPort too if you would like to have the proxy really used.
opts
- The FileSystem options.proxyHost
- the hostsetProxyPort(org.apache.commons.vfs2.FileSystemOptions, int)
public void setProxyPort(FileSystemOptions opts, int proxyPort)
opts
- The FileSystem options.proxyPort
- the portsetProxyHost(org.apache.commons.vfs2.FileSystemOptions, java.lang.String)
public java.lang.String getProxyHost(FileSystemOptions opts)
opts
- The FileSystem options.setProxyPort(org.apache.commons.vfs2.FileSystemOptions, int)
public int getProxyPort(FileSystemOptions opts)
opts
- The FileSystem options.setProxyHost(org.apache.commons.vfs2.FileSystemOptions, java.lang.String)
public void setProxyAuthenticator(FileSystemOptions opts, UserAuthenticator authenticator)
opts
- The FileSystem options.authenticator
- The UserAuthenticator.public UserAuthenticator getProxyAuthenticator(FileSystemOptions opts)
opts
- The FileSystem options.public void setCookies(FileSystemOptions opts, org.apache.http.cookie.Cookie[] cookies)
opts
- The FileSystem options.cookies
- An array of Cookies.public void setFollowRedirect(FileSystemOptions opts, boolean redirect)
opts
- The FileSystem options.redirect
- true
to follow redirects, false
not to.setFollowRedirect(org.apache.commons.vfs2.FileSystemOptions, boolean)
public org.apache.http.cookie.Cookie[] getCookies(FileSystemOptions opts)
opts
- The FileSystem options.public boolean getFollowRedirect(FileSystemOptions opts)
opts
- The FileSystem options.true
to follow redirects, false
not to.setFollowRedirect(org.apache.commons.vfs2.FileSystemOptions, boolean)
public void setMaxTotalConnections(FileSystemOptions opts, int maxTotalConnections)
opts
- The FileSystem options.maxTotalConnections
- The maximum number of connections.public int getMaxTotalConnections(FileSystemOptions opts)
opts
- The FileSystemOptions.public void setMaxConnectionsPerHost(FileSystemOptions opts, int maxHostConnections)
opts
- The FileSystem options.maxHostConnections
- The maximum number of connections to a host.public int getMaxConnectionsPerHost(FileSystemOptions opts)
opts
- The FileSystemOptions.public boolean isPreemptiveAuth(FileSystemOptions opts)
opts
- The FileSystemOptions.public void setPreemptiveAuth(FileSystemOptions opts, boolean preemptiveAuth)
opts
- The FileSystemOptions.preemptiveAuth
- the desired setting; true=enabled and false=disabled.public void setConnectionTimeout(FileSystemOptions opts, int connectionTimeout)
opts
- The FileSystem options.connectionTimeout
- The connection timeout.public int getConnectionTimeout(FileSystemOptions opts)
opts
- The FileSystem options.public void setSoTimeout(FileSystemOptions opts, int soTimeout)
opts
- The FileSystem options.soTimeout
- socket timeout.public int getSoTimeout(FileSystemOptions opts)
opts
- The FileSystemOptions.public void setKeepAlive(FileSystemOptions opts, boolean keepAlive)
opts
- The FileSystemOptions.keepAlive
- whether the FileSystemOptions indicate that HTTP Keep-Alive is respected or not.public boolean isKeepAlive(FileSystemOptions opts)
opts
- The FileSystemOptions.public void setUserAgent(FileSystemOptions opts, java.lang.String userAgent)
opts
- the file system options to modifyuserAgent
- User Agent Stringpublic java.lang.String getUserAgent(FileSystemOptions opts)
opts
- the file system options to modifypublic void setKeyStoreFile(FileSystemOptions opts, java.lang.String keyStoreFile)
opts
- the file system options to modifykeyStoreFile
- keystore file pathpublic java.lang.String getKeyStoreFile(FileSystemOptions opts)
opts
- the file system options to modifypublic void setKeyStorePass(FileSystemOptions opts, java.lang.String keyStorePass)
opts
- the file system options to modifykeyStorePass
- keystore pass phrase for SSL connecdtionsjava.lang.String getKeyStorePass(FileSystemOptions opts)
opts
- the file system options to modifypublic void setHostnameVerificationEnabled(FileSystemOptions opts, boolean hostnameVerificationEnabled)
opts
- The FileSystemOptions.hostnameVerificationEnabled
- whether hostname should be verifiedpublic boolean isHostnameVerificationEnabled(FileSystemOptions opts)
opts
- The FileSystemOptions.protected java.lang.Class<? extends FileSystem> getConfigClass()
FileSystemConfigBuilder
getConfigClass
in class FileSystemConfigBuilder