public class HttpFileSystemConfigBuilder extends FileSystemConfigBuilder
Modifier and Type | Field and Description |
---|---|
protected static String |
KEY_FOLLOW_REDIRECT |
protected static String |
KEY_USER_AGENT |
Modifier | Constructor and Description |
---|---|
protected |
HttpFileSystemConfigBuilder(String prefix)
Creates new config builder.
|
Modifier and Type | Method and Description |
---|---|
protected Class<? extends FileSystem> |
getConfigClass()
Gets the target of this configuration.
|
int |
getConnectionTimeout(FileSystemOptions opts)
Deprecated.
|
Duration |
getConnectionTimeoutDuration(FileSystemOptions opts)
Gets the connection timeout.
|
org.apache.commons.httpclient.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 HttpFileSystemConfigBuilder |
getInstance()
Gets the singleton builder.
|
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.
|
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)
Deprecated.
|
Duration |
getSoTimeoutDuration(FileSystemOptions opts)
Gets the socket timeout.
|
String |
getUrlCharset(FileSystemOptions opts)
Gets the charset used for url encoding.
|
String |
getUserAgent(FileSystemOptions opts)
Gets the user agent string
|
boolean |
isPreemptiveAuth(FileSystemOptions opts)
Determines if the FileSystemOptions indicate that preemptive authentication is requested.
|
void |
setConnectionTimeout(FileSystemOptions opts,
Duration timeout)
The connection timeout.
|
void |
setConnectionTimeout(FileSystemOptions opts,
int timeout)
Deprecated.
|
void |
setCookies(FileSystemOptions opts,
org.apache.commons.httpclient.Cookie[] cookies)
The cookies to add to the request.
|
void |
setFollowRedirect(FileSystemOptions opts,
boolean redirect)
Sets whether to follow redirects for the connection.
|
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,
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,
Duration timeout)
The socket timeout.
|
void |
setSoTimeout(FileSystemOptions opts,
int timeout)
Deprecated.
|
void |
setUrlCharset(FileSystemOptions opts,
String charset)
Sets the charset used for url encoding.
|
void |
setUserAgent(FileSystemOptions opts,
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, getDuration, getDuration, getDurationInteger, getDurationInteger, getEnum, getEnum, getFloat, getFloat, getFloat, getInteger, getInteger, getInteger, getLong, getLong, getLong, getParam, getRootURI, getShort, getShort, getShort, getString, getString, hasObject, hasParam, setParam, setParam, setRootURI, toBooleanObject
protected static final String KEY_FOLLOW_REDIRECT
protected static final String KEY_USER_AGENT
protected HttpFileSystemConfigBuilder(String prefix)
prefix
- String for properties of this file system.public static HttpFileSystemConfigBuilder getInstance()
protected Class<? extends FileSystem> getConfigClass()
FileSystemConfigBuilder
getConfigClass
in class FileSystemConfigBuilder
@Deprecated public int getConnectionTimeout(FileSystemOptions opts)
getConnectionTimeoutDuration(FileSystemOptions)
.opts
- The FileSystem options.public Duration getConnectionTimeoutDuration(FileSystemOptions opts)
opts
- The FileSystem options.public org.apache.commons.httpclient.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 int getMaxConnectionsPerHost(FileSystemOptions opts)
opts
- The FileSystemOptions.public int getMaxTotalConnections(FileSystemOptions opts)
opts
- The FileSystemOptions.public UserAuthenticator getProxyAuthenticator(FileSystemOptions opts)
opts
- The FileSystem options.public 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)
@Deprecated public int getSoTimeout(FileSystemOptions opts)
getSoTimeoutDuration(FileSystemOptions)
.opts
- The FileSystemOptions.public Duration getSoTimeoutDuration(FileSystemOptions opts)
opts
- The FileSystemOptions.public String getUrlCharset(FileSystemOptions opts)
opts
- The FileSystem options.public String getUserAgent(FileSystemOptions opts)
opts
- the file system options to modifypublic boolean isPreemptiveAuth(FileSystemOptions opts)
opts
- The FileSystemOptions.public void setConnectionTimeout(FileSystemOptions opts, Duration timeout)
opts
- The FileSystem options.timeout
- The connection timeout.@Deprecated public void setConnectionTimeout(FileSystemOptions opts, int timeout)
setConnectionTimeout(FileSystemOptions, Duration)
.opts
- The FileSystem options.timeout
- The connection timeout.public void setCookies(FileSystemOptions opts, org.apache.commons.httpclient.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 void setMaxConnectionsPerHost(FileSystemOptions opts, int maxHostConnections)
opts
- The FileSystem options.maxHostConnections
- The maximum number of connections to a host.public void setMaxTotalConnections(FileSystemOptions opts, int maxTotalConnections)
opts
- The FileSystem options.maxTotalConnections
- The maximum number of connections.public void setPreemptiveAuth(FileSystemOptions opts, boolean preemptiveAuth)
opts
- The FileSystemOptions.preemptiveAuth
- the desired setting; true=enabled and false=disabled.public void setProxyAuthenticator(FileSystemOptions opts, UserAuthenticator authenticator)
opts
- The FileSystem options.authenticator
- The UserAuthenticator.public void setProxyHost(FileSystemOptions opts, 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 void setSoTimeout(FileSystemOptions opts, Duration timeout)
opts
- The FileSystem options.timeout
- socket timeout.@Deprecated public void setSoTimeout(FileSystemOptions opts, int timeout)
setSoTimeout(FileSystemOptions, Duration)
.opts
- The FileSystem options.timeout
- socket timeout.public void setUrlCharset(FileSystemOptions opts, String charset)
opts
- The FileSystem options.charset
- the charset name.public void setUserAgent(FileSystemOptions opts, String userAgent)
opts
- the file system options to modifyuserAgent
- User Agent StringCopyright © 2002–2020 The Apache Software Foundation. All rights reserved.