Class Http4FileSystem
- java.lang.Object
-
- org.apache.commons.vfs2.provider.AbstractVfsComponent
-
- org.apache.commons.vfs2.provider.AbstractFileSystem
-
- org.apache.commons.vfs2.provider.http4.Http4FileSystem
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,FileSystem
,VfsComponent
public class Http4FileSystem extends AbstractFileSystem
http4 file system.- Since:
- 2.3
-
-
Field Summary
Fields Modifier and Type Field Description private org.apache.http.client.HttpClient
httpClient
InternalHttpClient
instance of this file system.private org.apache.http.client.protocol.HttpClientContext
httpClientContext
InternalHttpClientContext
instance of this file system.private java.net.URI
internalBaseURI
Internal base URI of this file system.
-
Constructor Summary
Constructors Modifier Constructor Description protected
Http4FileSystem(FileName rootName, FileSystemOptions fileSystemOptions, org.apache.http.client.HttpClient httpClient, org.apache.http.client.protocol.HttpClientContext httpClientContext)
ConstructHttp4FileSystem
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addCapabilities(java.util.Collection<Capability> caps)
Adds the capabilities of this file system.protected FileObject
createFile(AbstractFileName name)
Creates a file object.protected void
doCloseCommunicationLink()
Closes the underlying link used to access the files.protected org.apache.http.client.HttpClient
getHttpClient()
Return the internalHttpClient
instance.protected org.apache.http.client.protocol.HttpClientContext
getHttpClientContext()
Return the internalHttpClientContext
instance.protected java.net.URI
getInternalBaseURI()
Return the internal baseURI
instance.-
Methods inherited from class org.apache.commons.vfs2.provider.AbstractFileSystem
addJunction, addListener, close, closeCommunicationLink, decorateFileObject, doReplicateFile, fireFileChanged, fireFileCreated, fireFileDeleted, getAttribute, getFileFromCache, getFileSystemManager, getFileSystemOptions, getLastModTimeAccuracy, getParentLayer, getRoot, getRootName, getRootURI, hasCapability, init, isOpen, isReleaseable, notifyAllStreamsClosed, putFileToCache, removeFileFromCache, removeJunction, removeListener, replicateFile, resolveFile, resolveFile, setAttribute
-
Methods inherited from class org.apache.commons.vfs2.provider.AbstractVfsComponent
getContext, getLogger, setContext, setLogger
-
-
-
-
Field Detail
-
internalBaseURI
private final java.net.URI internalBaseURI
Internal base URI of this file system.
-
httpClient
private final org.apache.http.client.HttpClient httpClient
InternalHttpClient
instance of this file system.
-
httpClientContext
private final org.apache.http.client.protocol.HttpClientContext httpClientContext
InternalHttpClientContext
instance of this file system.
-
-
Constructor Detail
-
Http4FileSystem
protected Http4FileSystem(FileName rootName, FileSystemOptions fileSystemOptions, org.apache.http.client.HttpClient httpClient, org.apache.http.client.protocol.HttpClientContext httpClientContext)
ConstructHttp4FileSystem
.- Parameters:
rootName
- root base namefileSystemOptions
- file system optionshttpClient
-HttpClient
instancehttpClientContext
-HttpClientContext
instance
-
-
Method Detail
-
addCapabilities
protected void addCapabilities(java.util.Collection<Capability> caps)
Description copied from class:AbstractFileSystem
Adds the capabilities of this file system.- Specified by:
addCapabilities
in classAbstractFileSystem
- Parameters:
caps
- collections of Capabilities, can be immutable.
-
createFile
protected FileObject createFile(AbstractFileName name) throws java.lang.Exception
Description copied from class:AbstractFileSystem
Creates a file object.This method is called only if the requested file is not cached.
- Specified by:
createFile
in classAbstractFileSystem
- Parameters:
name
- name referencing the new file.- Returns:
- new created FileObject.
- Throws:
java.lang.Exception
- might throw an Exception, which is then wrapped in FileSystemException.
-
doCloseCommunicationLink
protected void doCloseCommunicationLink()
Description copied from class:AbstractFileSystem
Closes the underlying link used to access the files.- Overrides:
doCloseCommunicationLink
in classAbstractFileSystem
-
getHttpClient
protected org.apache.http.client.HttpClient getHttpClient()
Return the internalHttpClient
instance.- Returns:
- the internal
HttpClient
instance
-
getHttpClientContext
protected org.apache.http.client.protocol.HttpClientContext getHttpClientContext()
Return the internalHttpClientContext
instance.- Returns:
- the internal
HttpClientContext
instance
-
getInternalBaseURI
protected java.net.URI getInternalBaseURI()
Return the internal baseURI
instance.- Returns:
- the internal base
URI
instance
-
-