public class HttpFileSystemConfigBuilder extends FileSystemConfigBuilder
Modifier and Type | Field | Description |
---|---|---|
protected static java.lang.String |
KEY_FOLLOW_REDIRECT |
|
protected static java.lang.String |
KEY_USER_AGENT |
Modifier | Constructor | Description |
---|---|---|
protected |
HttpFileSystemConfigBuilder(java.lang.String prefix) |
Create new config builder.
|
Modifier and Type | Method | Description |
---|---|---|
protected java.lang.Class<? extends FileSystem> |
getConfigClass() |
Get the target of this configuration.
|
int |
getConnectionTimeout(FileSystemOptions opts) |
Retrieve the connection timeout.
|
org.apache.commons.httpclient.Cookie[] |
getCookies(FileSystemOptions opts) |
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) |
Retrieve the maximum number of connections allowed per host.
|
int |
getMaxTotalConnections(FileSystemOptions opts) |
Retrieve the maximum number of connections allowed.
|
UserAuthenticator |
getProxyAuthenticator(FileSystemOptions opts) |
Get the proxy authenticator where the system should get the credentials from.
|
java.lang.String |
getProxyHost(FileSystemOptions opts) |
Get the proxy to use for http connection.
|
int |
getProxyPort(FileSystemOptions opts) |
Get the proxy-port to use for http the connection.
|
int |
getSoTimeout(FileSystemOptions opts) |
Retrieve the socket timeout.
|
java.lang.String |
getUrlCharset(FileSystemOptions opts) |
Set the charset used for url encoding.
|
java.lang.String |
getUserAgent(FileSystemOptions opts) |
Return the user agent string
|
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.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) |
The maximum number of connections allowed to any host.
|
void |
setMaxTotalConnections(FileSystemOptions opts,
int maxTotalConnections) |
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) |
Set the proxy authenticator where the system should get the credentials from.
|
void |
setProxyHost(FileSystemOptions opts,
java.lang.String proxyHost) |
Set the proxy to use for http connection.
You have to set the ProxyPort too if you would like to have the proxy really used. |
void |
setProxyPort(FileSystemOptions opts,
int proxyPort) |
Set 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) |
Set the charset used for url encoding.
|
void |
setUserAgent(FileSystemOptions opts,
java.lang.String userAgent) |
Assign 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
protected static final java.lang.String KEY_FOLLOW_REDIRECT
protected static final java.lang.String KEY_USER_AGENT
protected HttpFileSystemConfigBuilder(java.lang.String prefix)
prefix
- String for properties of this file system.public static HttpFileSystemConfigBuilder 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)
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.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 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 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 setUserAgent(FileSystemOptions opts, java.lang.String userAgent)
userAgent
- User Agent Stringpublic java.lang.String getUserAgent(FileSystemOptions opts)
protected java.lang.Class<? extends FileSystem> getConfigClass()
FileSystemConfigBuilder
getConfigClass
in class FileSystemConfigBuilder