FS
- An Http5FileSystem
subclasspublic class Http5FileObject<FS extends Http5FileSystem> extends AbstractFileObject<FS>
DEFAULT_BUFFER_SIZE
EMPTY_ARRAY
Modifier | Constructor and Description |
---|---|
protected |
Http5FileObject(AbstractFileName name,
FS fileSystem)
Construct
Http4FileObject . |
protected |
Http5FileObject(AbstractFileName name,
FS fileSystem,
Http5FileSystemConfigBuilder builder)
Construct
Http4FileObject . |
Modifier and Type | Method and Description |
---|---|
protected void |
doDetach()
Detaches this file object from its file resource.
|
protected long |
doGetContentSize()
Returns the size of the file content (in bytes).
|
protected InputStream |
doGetInputStream(int bufferSize)
Creates an input stream to read the file content from.
|
protected long |
doGetLastModifiedTime()
Returns the last modified time of this file.
|
protected RandomAccessContent |
doGetRandomAccessContent(RandomAccessMode mode)
Creates access to the file for random i/o.
|
protected FileType |
doGetType()
Determines the type of this file.
|
protected boolean |
doIsWriteable()
Determines if this file can be written to.
|
protected String[] |
doListChildren()
Lists the children of this file.
|
protected org.apache.hc.core5.http.ClassicHttpResponse |
executeHttpUriRequest(org.apache.hc.client5.http.classic.methods.HttpUriRequest httpRequest)
Execute the request using the given
httpRequest and return a ClassicHttpResponse from the execution. |
protected FileContentInfoFactory |
getFileContentInfoFactory()
Creates the FileContentInfo factory.
|
protected URI |
getInternalURI()
Return the internal
URI object mapped to this file object. |
protected String |
getUrlCharset()
Return URL charset string.
|
canRenameTo, 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, toString
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getPath, getURI
forEach, spliterator
protected Http5FileObject(AbstractFileName name, FS fileSystem) throws FileSystemException
Http4FileObject
.name
- file namefileSystem
- file systemFileSystemException
- if any error occursprotected Http5FileObject(AbstractFileName name, FS fileSystem, Http5FileSystemConfigBuilder builder) throws FileSystemException
Http4FileObject
.name
- file namefileSystem
- file systembuilder
- Http4FileSystemConfigBuilder
objectFileSystemException
- if any error occursprotected void doDetach() throws Exception
AbstractFileObject
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.
doDetach
in class AbstractFileObject<FS extends Http5FileSystem>
Exception
- if an error occurs.protected long doGetContentSize() throws Exception
AbstractFileObject
AbstractFileObject.doGetType()
returns
FileType.FILE
.doGetContentSize
in class AbstractFileObject<FS extends Http5FileSystem>
Exception
- if an error occurs.protected InputStream doGetInputStream(int bufferSize) throws Exception
AbstractFileObject
AbstractFileObject.doGetType()
returns
FileType.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.
doGetInputStream
in class AbstractFileObject<FS extends Http5FileSystem>
bufferSize
- Buffer size hint.Exception
- if an error occurs.protected long doGetLastModifiedTime() throws Exception
AbstractFileObject
AbstractFileObject.doGetType()
does not return
This implementation throws an exception.
doGetLastModifiedTime
in class AbstractFileObject<FS extends Http5FileSystem>
Exception
- if an error occurs.protected RandomAccessContent doGetRandomAccessContent(RandomAccessMode mode) throws Exception
AbstractFileObject
AbstractFileObject.doGetType()
returns FileType.FILE
.
It is guaranteed that there are no open output streams for this file when this method is called.
doGetRandomAccessContent
in class AbstractFileObject<FS extends Http5FileSystem>
mode
- The mode to access the file.Exception
- if an error occurs.protected FileType doGetType() throws Exception
AbstractFileObject
doGetType
in class AbstractFileObject<FS extends Http5FileSystem>
Exception
- if an error occurs.protected boolean doIsWriteable() throws Exception
AbstractFileObject
AbstractFileObject.doGetType()
does not return
FileType.IMAGINARY
.
This implementation always returns true.
doIsWriteable
in class AbstractFileObject<FS extends Http5FileSystem>
Exception
- if an error occurs.protected String[] doListChildren() throws Exception
AbstractFileObject
AbstractFileObject.doGetType()
returns FileType.FOLDER
. The return
value of this method is cached, so the implementation can be expensive.doListChildren
in class AbstractFileObject<FS extends Http5FileSystem>
Exception
- if an error occurs.protected org.apache.hc.core5.http.ClassicHttpResponse executeHttpUriRequest(org.apache.hc.client5.http.classic.methods.HttpUriRequest httpRequest) throws IOException
httpRequest
and return a ClassicHttpResponse
from the execution.httpRequest
- HttpUriRequest
objectClassicHttpResponse
from the executionIOException
- if IO error occursprotected FileContentInfoFactory getFileContentInfoFactory()
AbstractFileObject
getFileContentInfoFactory
in class AbstractFileObject<FS extends Http5FileSystem>
protected URI getInternalURI()
URI
object mapped to this file object.URI
object mapped to this file objectprotected String getUrlCharset()
Copyright © 2002–2020 The Apache Software Foundation. All rights reserved.