org.apache.commons.vfs2.provider.bzip2
Class Bzip2FileObject

java.lang.Object
  extended by org.apache.commons.vfs2.provider.AbstractFileObject
      extended by org.apache.commons.vfs2.provider.compressed.CompressedFileFileObject
          extended by org.apache.commons.vfs2.provider.bzip2.Bzip2FileObject
All Implemented Interfaces:
FileObject

public class Bzip2FileObject
extends CompressedFileFileObject

the bzip2 file.

Author:
Commons VFS team

Constructor Summary
protected Bzip2FileObject(AbstractFileName name, FileObject container, CompressedFileFileSystem fs)
           
 
Method Summary
protected  InputStream doGetInputStream()
          Creates an input stream to read the file content from.
protected  OutputStream doGetOutputStream(boolean bAppend)
          Creates an output stream to write the file content to.
static InputStream wrapInputStream(String name, InputStream is)
           
 
Methods inherited from class org.apache.commons.vfs2.provider.compressed.CompressedFileFileObject
createFile, doGetContentSize, doGetLastModifiedTime, doGetType, doListChildren, getContainer, isWriteable
 
Methods inherited from class org.apache.commons.vfs2.provider.AbstractFileObject
canRenameTo, childrenChanged, close, copyFrom, createFolder, delete, delete, doAttach, doCreateFileContent, doCreateFolder, doDelete, doDetach, doGetAttributes, doGetCertificates, doGetRandomAccessContent, doIsHidden, doIsReadable, doIsSameFile, doIsWriteable, doListChildrenResolved, doRemoveAttribute, 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.vfs2.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

Bzip2FileObject

protected Bzip2FileObject(AbstractFileName name,
                          FileObject container,
                          CompressedFileFileSystem fs)
Method Detail

doGetInputStream

protected InputStream doGetInputStream()
                                throws Exception
Description copied from class: AbstractFileObject
Creates an input stream to read the file content from. Is only called if 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.

Specified by:
doGetInputStream in class AbstractFileObject
Returns:
An InputStream to read the file content.
Throws:
Exception - if an error occurs.

wrapInputStream

public static InputStream wrapInputStream(String name,
                                          InputStream is)
                                   throws IOException
Throws:
IOException

doGetOutputStream

protected OutputStream doGetOutputStream(boolean bAppend)
                                  throws Exception
Description copied from class: AbstractFileObject
Creates an output stream to write the file content to. Is only called if:

It is guaranteed that there are no open stream (input or output) for this file when this method is called.

The returned stream does not have to be buffered.

This implementation throws an exception.

Overrides:
doGetOutputStream in class AbstractFileObject
Parameters:
bAppend - true if the file should be appended to, false if it should be overwritten.
Returns:
An OutputStream to write to the file.
Throws:
Exception - if an error occurs.


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