FS
- An Http4FileSystem
subclasspublic class Http4FileObject<FS extends Http4FileSystem> extends AbstractFileObject<FS>
Modifier | Constructor and Description |
---|---|
protected |
Http4FileObject(AbstractFileName name,
FS fileSystem)
Construct
Http4FileObject . |
protected |
Http4FileObject(AbstractFileName name,
FS fileSystem,
Http4FileSystemConfigBuilder 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()
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 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, 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, 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
forEach, spliterator
protected Http4FileObject(AbstractFileName name, FS fileSystem) throws FileSystemException, URISyntaxException
Http4FileObject
.name
- file namefileSystem
- file systemFileSystemException
- if any error occursURISyntaxException
- if given file name cannot be converted to a URI due to URI syntax errorprotected Http4FileObject(AbstractFileName name, FS fileSystem, Http4FileSystemConfigBuilder builder) throws FileSystemException, URISyntaxException
Http4FileObject
.name
- file namefileSystem
- file systembuilder
- Http4FileSystemConfigBuilder
objectFileSystemException
- if any error occursURISyntaxException
- if given file name cannot be converted to a URI due to URI syntax errorprotected FileType doGetType() throws Exception
AbstractFileObject
doGetType
in class AbstractFileObject<FS extends Http4FileSystem>
Exception
- if an error occurs.protected long doGetContentSize() throws Exception
AbstractFileObject
AbstractFileObject.doGetType()
returns
FileType.FILE
.doGetContentSize
in class AbstractFileObject<FS extends Http4FileSystem>
Exception
- if an error occurs.protected long doGetLastModifiedTime() throws Exception
AbstractFileObject
AbstractFileObject.doGetType()
does not return
FileType.IMAGINARY
.
This implementation throws an exception.
doGetLastModifiedTime
in class AbstractFileObject<FS extends Http4FileSystem>
Exception
- if an error occurs.protected InputStream doGetInputStream() 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 Http4FileSystem>
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 Http4FileSystem>
mode
- The mode to access the file.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 Http4FileSystem>
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 Http4FileSystem>
Exception
- if an error occurs.protected FileContentInfoFactory getFileContentInfoFactory()
AbstractFileObject
getFileContentInfoFactory
in class AbstractFileObject<FS extends Http4FileSystem>
protected 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 Http4FileSystem>
Exception
- if an error occurs.protected String getUrlCharset()
protected URI getInternalURI() throws FileSystemException
URI
object mapped to this file object.URI
object mapped to this file objectFileSystemException
- if any error occursCopyright © 2002–2021 The Apache Software Foundation. All rights reserved.