org.apache.commons.vfs.provider.compressed
Class CompressedFileFileObject

java.lang.Object
  extended byorg.apache.commons.vfs.provider.AbstractFileObject
      extended byorg.apache.commons.vfs.provider.compressed.CompressedFileFileObject
All Implemented Interfaces:
FileObject
Direct Known Subclasses:
Bzip2FileObject, GzipFileObject

public abstract class CompressedFileFileObject
extends AbstractFileObject
implements FileObject

A compressed file.
Such a file do only have one child (the compressed filename with stripped last extension)

Version:
$Revision: 480428 $ $Date: 2006-11-29 07:15:24 +0100 (Mi, 29 Nov 2006) $
Author:
Mario Ivankovits

Constructor Summary
protected CompressedFileFileObject(FileName name, FileObject container, CompressedFileFileSystem fs)
           
 
Method Summary
 void createFile()
          Creates this file, if it does not exist.
protected  long doGetContentSize()
          Returns the size of the file content (in bytes).
protected  long doGetLastModifiedTime()
          Returns the last modified time of this file.
protected  FileType doGetType()
          Returns the file's type.
protected  String[] doListChildren()
          Lists the children of the file.
protected  FileObject getContainer()
           
 boolean isWriteable()
          Determines if this file can be written to.
 
Methods inherited from class org.apache.commons.vfs.provider.AbstractFileObject
canRenameTo, childrenChanged, childrenChanged, close, copyFrom, createFolder, delete, delete, doAttach, doCreateFolder, doDelete, doDetach, doGetAttributes, doGetCertificates, doGetInputStream, 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, 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

CompressedFileFileObject

protected CompressedFileFileObject(FileName name,
                                   FileObject container,
                                   CompressedFileFileSystem fs)
Method Detail

isWriteable

public boolean isWriteable()
                    throws FileSystemException
Determines if this file can be written to.

Specified by:
isWriteable in interface FileObject
Overrides:
isWriteable in class AbstractFileObject
Returns:
true if this file is writeable, false if not.
Throws:
FileSystemException

doGetType

protected FileType doGetType()
                      throws FileSystemException
Returns the file's type.

Specified by:
doGetType in class AbstractFileObject
Throws:
FileSystemException

doListChildren

protected String[] doListChildren()
Lists the children of the file.

Specified by:
doListChildren in class AbstractFileObject

doGetContentSize

protected long doGetContentSize()
Returns the size of the file content (in bytes). Is only called if doGetType() returns FileType.FILE.

Specified by:
doGetContentSize in class AbstractFileObject

doGetLastModifiedTime

protected long doGetLastModifiedTime()
                              throws Exception
Returns the last modified time of this file.

Overrides:
doGetLastModifiedTime in class AbstractFileObject
Throws:
Exception

getContainer

protected FileObject getContainer()

createFile

public void createFile()
                throws FileSystemException
Description copied from interface: FileObject
Creates this file, if it does not exist. Also creates any ancestor folders which do not exist. This method does nothing if the file already exists and is a file.

Specified by:
createFile in interface FileObject
Overrides:
createFile in class AbstractFileObject
Throws:
FileSystemException


Copyright © 2002-2006 The Apache Software Foundation. All Rights Reserved.