Class Http5FileProvider
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.http5.Http5FileProvider
- All Implemented Interfaces:
Closeable
,AutoCloseable
,FileProvider
,VfsComponent
- Direct Known Subclasses:
Http5sFileProvider
FileProvider
implementation using HttpComponents HttpClient v5 library.- Since:
- 2.5.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.hc.client5.http.classic.HttpClient
createHttpClient
(Http5FileSystemConfigBuilder builder, GenericFileName rootName, FileSystemOptions fileSystemOptions) Create anHttpClient
object for an http4 file system.protected org.apache.hc.client5.http.impl.classic.HttpClientBuilder
createHttpClientBuilder
(Http5FileSystemConfigBuilder builder, GenericFileName rootName, FileSystemOptions fileSystemOptions) Create anHttpClientBuilder
object.protected org.apache.hc.client5.http.protocol.HttpClientContext
createHttpClientContext
(Http5FileSystemConfigBuilder builder, GenericFileName rootName, FileSystemOptions fileSystemOptions, UserAuthenticationData authData) Create anHttpClientContext
object for an http4 file system.protected SSLContext
createSSLContext
(Http5FileSystemConfigBuilder builder, FileSystemOptions fileSystemOptions) CreateSSLContext
for HttpClient.protected FileSystem
doCreateFileSystem
(FileName name, FileSystemOptions fileSystemOptions) Creates aFileSystem
.Gets the file system capabilities.Gets the FileSystemConfigBuilder.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
-
Constructor Details
-
Http5FileProvider
public Http5FileProvider()Constructs a new provider.
-
-
Method Details
-
createHttpClient
protected org.apache.hc.client5.http.classic.HttpClient createHttpClient(Http5FileSystemConfigBuilder 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.hc.client5.http.impl.classic.HttpClientBuilder createHttpClientBuilder(Http5FileSystemConfigBuilder builder, GenericFileName rootName, FileSystemOptions fileSystemOptions) throws FileSystemException Create anHttpClientBuilder
object. Invoked bycreateHttpClient(Http5FileSystemConfigBuilder, 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.hc.client5.http.protocol.HttpClientContext createHttpClientContext(Http5FileSystemConfigBuilder 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
- TheUserAuthenticationData
object- Returns:
- an
HttpClientContext
object
-
createSSLContext
protected SSLContext createSSLContext(Http5FileSystemConfigBuilder builder, FileSystemOptions fileSystemOptions) throws FileSystemException CreateSSLContext
for HttpClient. Invoked bycreateHttpClientBuilder(Http5FileSystemConfigBuilder, 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, never null.
- Throws:
FileSystemException
- if an error occurs.
-
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 instantiated.
- Returns:
- a Collection of the file systems Capabilities.
-
getConfigBuilder
Description copied from class:AbstractFileProvider
Gets the FileSystemConfigBuilder.- Specified by:
getConfigBuilder
in interfaceFileProvider
- Overrides:
getConfigBuilder
in classAbstractFileProvider
- Returns:
- the FileSystemConfigBuilder.
-