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 file name with stripped last extension)
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intThe value returned bydoGetContentSize()when not overridden by a subclass.Fields inherited from class org.apache.commons.vfs2.provider.AbstractFileObjectDEFAULT_BUFFER_SIZEFields inherited from interface org.apache.commons.vfs2.FileObjectEMPTY_ARRAY
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedCompressedFileFileObject(AbstractFileName fileName, FileObject container, FS fileSystem) Constructs a new instance.
- 
Method SummaryModifier and TypeMethodDescriptionvoidCreates this file, if it does not exist.protected longReturns the size of the file content (in bytes).protected longReturns the last modified time of this file.protected FileTypeReturns the file's type.protected String[]Lists the children of the file.protected FileObjectGets the container.booleanDetermines if this file can be written to.Methods inherited from class org.apache.commons.vfs2.provider.AbstractFileObjectcanRenameTo, childrenChanged, close, compareTo, copyFrom, createFolder, delete, delete, deleteAll, doAttach, doCreateFileContent, doCreateFolder, doDelete, doDetach, doGetAttributes, doGetCertificates, doGetInputStream, doGetInputStream, doGetOutputStream, doGetRandomAccessContent, doIsExecutable, doIsHidden, doIsReadable, doIsSameFile, doIsSymbolicLink, doIsWriteable, doListChildrenResolved, doRemoveAttribute, doRename, doSetAttribute, doSetExecutable, doSetLastModifiedTime, doSetReadable, doSetWritable, endOutput, exists, finalize, findFiles, findFiles, getAbstractFileSystem, getChild, getChildren, getContent, getFileContentInfoFactory, 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, 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
- 
Field Details- 
SIZE_UNDEFINEDThe value returned bydoGetContentSize()when not overridden by a subclass.- Since:
- 2.5.0
- See Also:
 
 
- 
- 
Constructor Details- 
CompressedFileFileObjectConstructs a new instance.- Parameters:
- fileName- the file name.
- container- the container.
- fileSystem- the file system.
 
 
- 
- 
Method Details- 
createFileDescription copied from class:AbstractFileObjectCreates this file, if it does not exist.- Specified by:
- createFilein interface- FileObject
- Overrides:
- createFilein class- AbstractFileObject<FS extends CompressedFileFileSystem>
- Throws:
- FileSystemException- if an error occurs.
 
- 
doGetContentSizeReturns the size of the file content (in bytes). Is only called ifdoGetType()returnsFileType.FILE.- Specified by:
- doGetContentSizein class- AbstractFileObject<FS extends CompressedFileFileSystem>
- Returns:
- The size of the file in bytes.
 
- 
doGetLastModifiedTimeReturns the last modified time of this file.- Overrides:
- doGetLastModifiedTimein class- AbstractFileObject<FS extends CompressedFileFileSystem>
- Returns:
- The last modification time.
- Throws:
- Exception- if an error occurs.
 
- 
doGetTypeReturns the file's type.- Specified by:
- doGetTypein class- AbstractFileObject<FS extends CompressedFileFileSystem>
- Returns:
- the type of the file.
- Throws:
- FileSystemException
 
- 
doListChildrenLists the children of the file.- Specified by:
- doListChildrenin class- AbstractFileObject<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.
 
- 
getContainerGets the container.- Returns:
- the container.
 
- 
isWriteableDetermines if this file can be written to.- Specified by:
- isWriteablein interface- FileObject
- Overrides:
- isWriteablein class- AbstractFileObject<FS extends CompressedFileFileSystem>
- Returns:
- trueif this file is writable,- falseif not.
- Throws:
- FileSystemException- if an error occurs.
 
 
-