Class Http5FileObject<FS extends Http5FileSystem>
java.lang.Object
org.apache.commons.vfs2.provider.AbstractFileObject<FS>
org.apache.commons.vfs2.provider.http5.Http5FileObject<FS>
- Type Parameters:
- FS- An- Http5FileSystemsubclass
- All Implemented Interfaces:
- Closeable,- AutoCloseable,- Comparable<FileObject>,- Iterable<FileObject>,- FileObject
A file object backed by Apache HttpComponents HttpClient v5.
- Since:
- 2.5.0
- 
Field SummaryFields inherited from class org.apache.commons.vfs2.provider.AbstractFileObjectDEFAULT_BUFFER_SIZEFields inherited from interface org.apache.commons.vfs2.FileObjectEMPTY_ARRAY
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedHttp5FileObject(AbstractFileName name, FS fileSystem) ConstructsHttp4FileObject.protectedHttp5FileObject(AbstractFileName name, FS fileSystem, Http5FileSystemConfigBuilder builder) ConstructsHttp4FileObject.
- 
Method SummaryModifier and TypeMethodDescriptionprotected voiddoDetach()Detaches this file object from its file resource.protected longReturns the size of the file content (in bytes).protected InputStreamdoGetInputStream(int bufferSize) Creates an input stream to read the file content from.protected longReturns the last modified time of this file.protected RandomAccessContentCreates access to the file for random i/o.protected FileTypeDetermines the type of this file.protected booleanDetermines if this file can be written to.protected String[]Lists the children of this file.protected org.apache.hc.core5.http.ClassicHttpResponseexecuteHttpUriRequest(org.apache.hc.client5.http.classic.methods.HttpUriRequest httpRequest) Execute the request using the givenhttpRequestand return aClassicHttpResponsefrom the execution.protected FileContentInfoFactoryCreates the FileContentInfo factory.protected URIGets the internalURIobject mapped to this file object.protected StringGets URL charset string.Methods inherited from class org.apache.commons.vfs2.provider.AbstractFileObjectcanRenameTo, childrenChanged, close, compareTo, copyFrom, createFile, createFolder, delete, delete, deleteAll, doAttach, doCreateFileContent, doCreateFolder, doDelete, doGetAttributes, doGetCertificates, doGetInputStream, doGetOutputStream, doIsExecutable, doIsHidden, doIsReadable, doIsSameFile, doIsSymbolicLink, doListChildrenResolved, doRemoveAttribute, doRename, doSetAttribute, doSetExecutable, doSetLastModifiedTime, doSetReadable, doSetWritable, endOutput, exists, finalize, findFiles, findFiles, getAbstractFileSystem, getChild, getChildren, getContent, getFileOperations, getFileSystem, getInputStream, getInputStream, getName, getOutputStream, getOutputStream, getParent, getPublicURIString, getRandomAccessContent, getType, getURL, handleChanged, handleCreate, handleDelete, holdObject, injectType, isAttached, isContentOpen, isExecutable, isFile, isFolder, isHidden, isReadable, isSameFile, isSymbolicLink, isWriteable, iterator, listFiles, moveTo, notifyAllStreamsClosed, onChange, onChildrenChanged, refresh, resolveFile, resolveFile, setExecutable, setReadable, setWritable, toStringMethods inherited from class java.lang.Objectclone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.commons.vfs2.FileObjectgetPath, getURIMethods inherited from interface java.lang.IterableforEach, spliterator
- 
Constructor Details- 
Http5FileObjectConstructsHttp4FileObject.- Parameters:
- name- file name
- fileSystem- file system
- Throws:
- FileSystemException- if any error occurs
 
- 
Http5FileObjectprotected Http5FileObject(AbstractFileName name, FS fileSystem, Http5FileSystemConfigBuilder builder) throws FileSystemException ConstructsHttp4FileObject.- Parameters:
- name- file name
- fileSystem- file system
- builder-- Http4FileSystemConfigBuilderobject
- Throws:
- FileSystemException- if any error occurs
 
 
- 
- 
Method Details- 
doDetachDescription copied from class:AbstractFileObjectDetaches this file object from its file resource.Called when this file is closed. Note that the file object may be reused later, so should be able to be reattached. This implementation does nothing. - Overrides:
- doDetachin class- AbstractFileObject<FS extends Http5FileSystem>
- Throws:
- Exception- if an error occurs.
 
- 
doGetContentSizeDescription copied from class:AbstractFileObjectReturns the size of the file content (in bytes). Is only called ifAbstractFileObject.doGetType()returnsFileType.FILE.- Specified by:
- doGetContentSizein class- AbstractFileObject<FS extends Http5FileSystem>
- Returns:
- The size of the file in bytes.
- Throws:
- Exception- if an error occurs.
 
- 
doGetInputStreamDescription copied from class:AbstractFileObjectCreates an input stream to read the file content from. Is only called ifAbstractFileObject.doGetType()returnsFileType.FILE.It is guaranteed that there are no open output streams for this file when this method is called. The returned stream does not have to be buffered. - Overrides:
- doGetInputStreamin class- AbstractFileObject<FS extends Http5FileSystem>
- Parameters:
- bufferSize- Buffer size hint.
- Returns:
- An InputStream to read the file content.
- Throws:
- Exception- if an error occurs.
 
- 
doGetLastModifiedTimeDescription copied from class:AbstractFileObjectReturns the last modified time of this file. Is only called ifAbstractFileObject.doGetType()does not returnThis implementation throws an exception. - Overrides:
- doGetLastModifiedTimein class- AbstractFileObject<FS extends Http5FileSystem>
- Returns:
- The last modification time.
- Throws:
- Exception- if an error occurs.
 
- 
doGetRandomAccessContentDescription copied from class:AbstractFileObjectCreates access to the file for random i/o. Is only called ifAbstractFileObject.doGetType()returnsFileType.FILE.It is guaranteed that there are no open output streams for this file when this method is called. - Overrides:
- doGetRandomAccessContentin class- AbstractFileObject<FS extends Http5FileSystem>
- Parameters:
- mode- The mode to access the file.
- Returns:
- The RandomAccessContext.
- Throws:
- Exception- if an error occurs.
 
- 
doGetTypeDescription copied from class:AbstractFileObjectDetermines the type of this file. Must not return null. The return value of this method is cached, so the implementation can be expensive.- Specified by:
- doGetTypein class- AbstractFileObject<FS extends Http5FileSystem>
- Returns:
- the type of the file.
- Throws:
- Exception- if an error occurs.
 
- 
doIsWriteableDescription copied from class:AbstractFileObjectDetermines if this file can be written to. Is only called ifAbstractFileObject.doGetType()does not returnFileType.IMAGINARY.This implementation always returns true. - Overrides:
- doIsWriteablein class- AbstractFileObject<FS extends Http5FileSystem>
- Returns:
- true if the file is writable.
- Throws:
- Exception- if an error occurs.
 
- 
doListChildrenDescription copied from class:AbstractFileObjectLists the children of this file. Is only called ifAbstractFileObject.doGetType()returnsFileType.FOLDER. The return value of this method is cached, so the implementation can be expensive.- Specified by:
- doListChildrenin class- AbstractFileObject<FS extends Http5FileSystem>
- Returns:
- a possible empty String array if the file is a directory or null or an exception if the file is not a directory or can't be read.
- Throws:
- Exception- if an error occurs.
 
- 
executeHttpUriRequestprotected org.apache.hc.core5.http.ClassicHttpResponse executeHttpUriRequest(org.apache.hc.client5.http.classic.methods.HttpUriRequest httpRequest) throws IOException Execute the request using the givenhttpRequestand return aClassicHttpResponsefrom the execution.- Parameters:
- httpRequest-- HttpUriRequestobject
- Returns:
- ClassicHttpResponsefrom the execution
- Throws:
- IOException- if IO error occurs
 
- 
getFileContentInfoFactoryDescription copied from class:AbstractFileObjectCreates the FileContentInfo factory.- Overrides:
- getFileContentInfoFactoryin class- AbstractFileObject<FS extends Http5FileSystem>
- Returns:
- The FileContentInfoFactory.
 
- 
getInternalURIGets the internalURIobject mapped to this file object.- Returns:
- the internal URIobject mapped to this file object
 
- 
getUrlCharsetGets URL charset string.- Returns:
- URL charset string
 
 
-