Class CompressedFileFileObject<FS extends CompressedFileFileSystem>
java.lang.Object
org.apache.commons.vfs2.provider.AbstractFileObject<FS>
org.apache.commons.vfs2.provider.compressed.CompressedFileFileObject<FS>
- Type Parameters:
FS
- A CompressedFileFileSystem
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Comparable<FileObject>
,Iterable<FileObject>
,FileObject
- Direct Known Subclasses:
Bzip2FileObject
,GzipFileObject
public abstract class CompressedFileFileObject<FS extends CompressedFileFileSystem>
extends AbstractFileObject<FS>
A compressed file.
Such a file only has one child (the compressed filename with stripped last extension)
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
CompressedFileFileObject
(AbstractFileName name, FileObject container, FS fs) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Creates this file, if it does not exist.protected long
Returns the size of the file content (in bytes).protected long
Returns the last modified time of this file.protected FileType
Returns the file's type.protected String[]
Lists the children of the file.protected FileObject
boolean
Determines if this file can be written to.Methods inherited from class org.apache.commons.vfs2.provider.AbstractFileObject
canRenameTo, childrenChanged, close, compareTo, copyFrom, createFolder, delete, delete, deleteAll, doAttach, doCreateFileContent, doCreateFolder, doDelete, doDetach, doGetAttributes, doGetCertificates, doGetInputStream, doGetOutputStream, doGetRandomAccessContent, doIsExecutable, doIsHidden, doIsReadable, doIsSameFile, doIsWriteable, doListChildrenResolved, doRemoveAttribute, doRename, doSetAttribute, doSetExecutable, doSetLastModifiedTime, doSetReadable, doSetWritable, endOutput, exists, finalize, findFiles, findFiles, getAbstractFileSystem, getChild, getChildren, getContent, getFileContentInfoFactory, getFileOperations, getFileSystem, getInputStream, getName, getOutputStream, getOutputStream, getParent, getPublicURIString, getRandomAccessContent, getType, getURL, handleChanged, handleCreate, handleDelete, holdObject, injectType, isAttached, isContentOpen, isExecutable, isFile, isFolder, isHidden, isReadable, isSameFile, iterator, listFiles, moveTo, notifyAllStreamsClosed, onChange, onChildrenChanged, refresh, resolveFile, resolveFile, setExecutable, setReadable, setWritable, toString
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
CompressedFileFileObject
-
-
Method Details
-
isWriteable
Determines if this file can be written to.- Specified by:
isWriteable
in interfaceFileObject
- Overrides:
isWriteable
in classAbstractFileObject<FS extends CompressedFileFileSystem>
- Returns:
true
if this file is writeable,false
if not.- Throws:
FileSystemException
- if an error occurs.
-
doGetType
Returns the file's type.- Specified by:
doGetType
in classAbstractFileObject<FS extends CompressedFileFileSystem>
- Returns:
- the type of the file.
- Throws:
FileSystemException
-
doListChildren
Lists the children of the file.- Specified by:
doListChildren
in classAbstractFileObject<FS extends CompressedFileFileSystem>
- 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.
-
doGetContentSize
Returns the size of the file content (in bytes). Is only called ifdoGetType()
returnsFileType.FILE
.- Specified by:
doGetContentSize
in classAbstractFileObject<FS extends CompressedFileFileSystem>
- Returns:
- The size of the file in bytes.
-
doGetLastModifiedTime
Returns the last modified time of this file.- Overrides:
doGetLastModifiedTime
in classAbstractFileObject<FS extends CompressedFileFileSystem>
- Returns:
- The last modification time.
- Throws:
Exception
- if an error occurs.
-
getContainer
-
createFile
Description copied from class:AbstractFileObject
Creates this file, if it does not exist.- Specified by:
createFile
in interfaceFileObject
- Overrides:
createFile
in classAbstractFileObject<FS extends CompressedFileFileSystem>
- Throws:
FileSystemException
- if an error occurs.
-