Class Http4FileProvider
- java.lang.Object
-
- org.apache.commons.vfs2.provider.AbstractVfsComponent
-
- org.apache.commons.vfs2.provider.AbstractVfsContainer
-
- org.apache.commons.vfs2.provider.AbstractFileProvider
-
- org.apache.commons.vfs2.provider.AbstractOriginatingFileProvider
-
- org.apache.commons.vfs2.provider.http4.Http4FileProvider
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,FileProvider
,VfsComponent
- Direct Known Subclasses:
Http4sFileProvider
public class Http4FileProvider extends AbstractOriginatingFileProvider
FileProvider
implementation using HttpComponents HttpClient library.- Since:
- 2.3
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static UserAuthenticationData.Type[]
AUTHENTICATOR_TYPES
Authenticator information.(package private) static java.util.Collection<Capability>
CAPABILITIES
FileProvider capabilities
-
Constructor Summary
Constructors Constructor Description Http4FileProvider()
Constructs a new provider.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private org.apache.http.conn.HttpClientConnectionManager
createConnectionManager(Http4FileSystemConfigBuilder builder, FileSystemOptions fileSystemOptions, javax.net.ssl.SSLContext sslContext, javax.net.ssl.HostnameVerifier verifier)
private org.apache.http.client.CookieStore
createDefaultCookieStore(Http4FileSystemConfigBuilder builder, FileSystemOptions fileSystemOptions)
private org.apache.http.client.config.RequestConfig
createDefaultRequestConfig(Http4FileSystemConfigBuilder builder, FileSystemOptions fileSystemOptions)
private javax.net.ssl.HostnameVerifier
createHostnameVerifier(Http4FileSystemConfigBuilder builder, FileSystemOptions fileSystemOptions)
protected org.apache.http.client.HttpClient
createHttpClient(Http4FileSystemConfigBuilder builder, GenericFileName rootName, FileSystemOptions fileSystemOptions)
Create anHttpClient
object for an http4 file system.protected org.apache.http.impl.client.HttpClientBuilder
createHttpClientBuilder(Http4FileSystemConfigBuilder builder, GenericFileName rootName, FileSystemOptions fileSystemOptions)
Create anHttpClientBuilder
object.protected org.apache.http.client.protocol.HttpClientContext
createHttpClientContext(Http4FileSystemConfigBuilder builder, GenericFileName rootName, FileSystemOptions fileSystemOptions, UserAuthenticationData authData)
Create anHttpClientContext
object for an http4 file system.private org.apache.http.conn.routing.HttpRoutePlanner
createHttpRoutePlanner(Http4FileSystemConfigBuilder builder, FileSystemOptions fileSystemOptions)
protected javax.net.ssl.SSLContext
createSSLContext(Http4FileSystemConfigBuilder builder, FileSystemOptions fileSystemOptions)
CreateSSLContext
for HttpClient.protected FileSystem
doCreateFileSystem(FileName name, FileSystemOptions fileSystemOptions)
Creates aFileSystem
.java.util.Collection<Capability>
getCapabilities()
Gets the file system capabilities.FileSystemConfigBuilder
getConfigBuilder()
Returns the FileSystemConfigBuidler.private org.apache.http.HttpHost
getProxyHttpHost(Http4FileSystemConfigBuilder builder, FileSystemOptions fileSystemOptions)
-
Methods inherited from class org.apache.commons.vfs2.provider.AbstractOriginatingFileProvider
findFile, findFile, getFileSystem
-
Methods inherited from class org.apache.commons.vfs2.provider.AbstractFileProvider
addFileSystem, close, closeFileSystem, createFileSystem, findFileSystem, freeUnusedResources, getFileNameParser, parseUri, setFileNameParser
-
Methods inherited from class org.apache.commons.vfs2.provider.AbstractVfsContainer
addComponent, removeComponent
-
Methods inherited from class org.apache.commons.vfs2.provider.AbstractVfsComponent
getContext, getLogger, init, setContext, setLogger
-
-
-
-
Field Detail
-
AUTHENTICATOR_TYPES
static final UserAuthenticationData.Type[] AUTHENTICATOR_TYPES
Authenticator information.
-
CAPABILITIES
static final java.util.Collection<Capability> CAPABILITIES
FileProvider capabilities
-
-
Method Detail
-
createConnectionManager
private org.apache.http.conn.HttpClientConnectionManager createConnectionManager(Http4FileSystemConfigBuilder builder, FileSystemOptions fileSystemOptions, javax.net.ssl.SSLContext sslContext, javax.net.ssl.HostnameVerifier verifier)
-
createDefaultCookieStore
private org.apache.http.client.CookieStore createDefaultCookieStore(Http4FileSystemConfigBuilder builder, FileSystemOptions fileSystemOptions)
-
createDefaultRequestConfig
private org.apache.http.client.config.RequestConfig createDefaultRequestConfig(Http4FileSystemConfigBuilder builder, FileSystemOptions fileSystemOptions)
-
createHostnameVerifier
private javax.net.ssl.HostnameVerifier createHostnameVerifier(Http4FileSystemConfigBuilder builder, FileSystemOptions fileSystemOptions)
-
createHttpClient
protected org.apache.http.client.HttpClient createHttpClient(Http4FileSystemConfigBuilder builder, GenericFileName rootName, FileSystemOptions fileSystemOptions) throws FileSystemException
Create anHttpClient
object for an http4 file system.- Parameters:
builder
- Configuration options builder for http4 providerrootName
- The root pathfileSystemOptions
- The file system options- Returns:
- an
HttpClient
object - Throws:
FileSystemException
- if an error occurs.
-
createHttpClientBuilder
protected org.apache.http.impl.client.HttpClientBuilder createHttpClientBuilder(Http4FileSystemConfigBuilder builder, GenericFileName rootName, FileSystemOptions fileSystemOptions) throws FileSystemException
Create anHttpClientBuilder
object. Invoked bycreateHttpClient(Http4FileSystemConfigBuilder, GenericFileName, FileSystemOptions)
.- Parameters:
builder
- Configuration options builder for HTTP4 providerrootName
- The root pathfileSystemOptions
- The FileSystem options- Returns:
- an
HttpClientBuilder
object - Throws:
FileSystemException
- if an error occurs
-
createHttpClientContext
protected org.apache.http.client.protocol.HttpClientContext createHttpClientContext(Http4FileSystemConfigBuilder builder, GenericFileName rootName, FileSystemOptions fileSystemOptions, UserAuthenticationData authData)
Create anHttpClientContext
object for an http4 file system.- Parameters:
builder
- Configuration options builder for http4 providerrootName
- The root pathfileSystemOptions
- The FileSystem optionsauthData
- TheUserAuthentiationData
object- Returns:
- an
HttpClientContext
object
-
createHttpRoutePlanner
private org.apache.http.conn.routing.HttpRoutePlanner createHttpRoutePlanner(Http4FileSystemConfigBuilder builder, FileSystemOptions fileSystemOptions)
-
createSSLContext
protected javax.net.ssl.SSLContext createSSLContext(Http4FileSystemConfigBuilder builder, FileSystemOptions fileSystemOptions) throws FileSystemException
CreateSSLContext
for HttpClient. Invoked bycreateHttpClientBuilder(Http4FileSystemConfigBuilder, GenericFileName, FileSystemOptions)
.- Parameters:
builder
- Configuration options builder for HTTP4 providerfileSystemOptions
- The FileSystem options- Returns:
- a
SSLContext
for HttpClient - Throws:
FileSystemException
- if an error occurs
-
doCreateFileSystem
protected FileSystem doCreateFileSystem(FileName name, FileSystemOptions fileSystemOptions) throws FileSystemException
Description copied from class:AbstractOriginatingFileProvider
Creates aFileSystem
. If the returned FileSystem implementsVfsComponent
, it will be initialized.- Specified by:
doCreateFileSystem
in classAbstractOriginatingFileProvider
- Parameters:
name
- The name of the root file of the file system to create.fileSystemOptions
- The FileSystem options.- Returns:
- The FileSystem.
- Throws:
FileSystemException
- if an error occurs.
-
getCapabilities
public java.util.Collection<Capability> getCapabilities()
Description copied from interface:FileProvider
Gets the file system capabilities.These are the same as on the file system, but available before the first file system was instanciated.
- Returns:
- a Collection of the file systems Capabilities.
-
getConfigBuilder
public FileSystemConfigBuilder getConfigBuilder()
Description copied from class:AbstractFileProvider
Returns the FileSystemConfigBuidler.- Specified by:
getConfigBuilder
in interfaceFileProvider
- Overrides:
getConfigBuilder
in classAbstractFileProvider
- Returns:
- the FileSystemConfigBuilder.
-
getProxyHttpHost
private org.apache.http.HttpHost getProxyHttpHost(Http4FileSystemConfigBuilder builder, FileSystemOptions fileSystemOptions)
-
-