Class TarFileObject
- java.lang.Object
-
- org.apache.commons.vfs.provider.AbstractFileObject
-
- org.apache.commons.vfs.provider.tar.TarFileObject
-
- All Implemented Interfaces:
FileObject
public class TarFileObject extends AbstractFileObject implements FileObject
A file in a Tar file system.
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.commons.vfs.provider.tar.TarEntry
entry
-
Constructor Summary
Constructors Modifier Constructor Description protected
TarFileObject(FileName name, org.apache.commons.vfs.provider.tar.TarEntry entry, TarFileSystem fs, boolean tarExists)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
attachChild(FileName childName)
Attaches a childprotected long
doGetContentSize()
Returns the size of the file content (in bytes).protected java.io.InputStream
doGetInputStream()
Creates an input stream to read the file content from.protected long
doGetLastModifiedTime()
Returns the last modified time of this file.protected FileType
doGetType()
Returns the file's type.protected java.lang.String[]
doListChildren()
Lists the children of the file.boolean
isWriteable()
Determines if this file can be written to.protected void
setTarEntry(org.apache.commons.vfs.provider.tar.TarEntry entry)
Sets the details for this file object.-
Methods inherited from class org.apache.commons.vfs.provider.AbstractFileObject
canRenameTo, childrenChanged, childrenChanged, close, copyFrom, createFile, createFolder, delete, delete, doAttach, doCreateFolder, doDelete, doDetach, doGetAttributes, doGetCertificates, doGetOutputStream, doGetRandomAccessContent, doIsHidden, doIsReadable, doIsSameFile, doIsWriteable, doListChildrenResolved, doRename, doSetAttribute, doSetLastModifiedTime, endOutput, exists, finalize, findFiles, findFiles, getChild, getChildren, getContent, getFileContentInfoFactory, getFileOperations, getFileSystem, getInputStream, getName, getOutputStream, getOutputStream, getParent, getRandomAccessContent, getType, getURL, handleChanged, handleCreate, handleDelete, holdObject, injectType, isAttached, isContentOpen, isHidden, isReadable, isSameFile, moveTo, notifyAllStreamsClosed, onChange, onChildrenChanged, refresh, resolveFile, resolveFile, toString
-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.commons.vfs.FileObject
canRenameTo, close, copyFrom, createFile, createFolder, delete, delete, exists, findFiles, findFiles, getChild, getChildren, getContent, getFileOperations, getFileSystem, getName, getParent, getType, getURL, isAttached, isContentOpen, isHidden, isReadable, moveTo, refresh, resolveFile, resolveFile
-
-
-
-
Constructor Detail
-
TarFileObject
protected TarFileObject(FileName name, org.apache.commons.vfs.provider.tar.TarEntry entry, TarFileSystem fs, boolean tarExists) throws FileSystemException
- Throws:
FileSystemException
-
-
Method Detail
-
setTarEntry
protected void setTarEntry(org.apache.commons.vfs.provider.tar.TarEntry entry)
Sets the details for this file object.
-
attachChild
protected void attachChild(FileName childName)
Attaches a child
-
isWriteable
public boolean isWriteable() throws FileSystemException
Determines if this file can be written to.- Specified by:
isWriteable
in interfaceFileObject
- Overrides:
isWriteable
in classAbstractFileObject
- Returns:
true
if this file is writeable,false
if not.- Throws:
FileSystemException
- On error determining if this file exists.
-
doGetType
protected FileType doGetType()
Returns the file's type.- Specified by:
doGetType
in classAbstractFileObject
-
doListChildren
protected java.lang.String[] doListChildren()
Lists the children of the file.- Specified by:
doListChildren
in classAbstractFileObject
-
doGetContentSize
protected long doGetContentSize()
Returns the size of the file content (in bytes). Is only called ifdoGetType()
returnsFileType.FILE
.- Specified by:
doGetContentSize
in classAbstractFileObject
-
doGetLastModifiedTime
protected long doGetLastModifiedTime() throws java.lang.Exception
Returns the last modified time of this file.- Overrides:
doGetLastModifiedTime
in classAbstractFileObject
- Throws:
java.lang.Exception
-
doGetInputStream
protected java.io.InputStream doGetInputStream() throws java.lang.Exception
Creates an input stream to read the file content from. Is only called ifdoGetType()
returnsFileType.FILE
. The input stream returned by this method is guaranteed to be closed before this method is called again.- Specified by:
doGetInputStream
in classAbstractFileObject
- Throws:
java.lang.Exception
-
-