Class Bzip2FileObject
- java.lang.Object
-
- org.apache.commons.vfs2.provider.AbstractFileObject<FS>
-
- org.apache.commons.vfs2.provider.compressed.CompressedFileFileObject<Bzip2FileSystem>
-
- org.apache.commons.vfs2.provider.bzip2.Bzip2FileObject
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,java.lang.Comparable<FileObject>
,java.lang.Iterable<FileObject>
,FileObject
public class Bzip2FileObject extends CompressedFileFileObject<Bzip2FileSystem>
the bzip2 file.
-
-
Field Summary
-
Fields inherited from class org.apache.commons.vfs2.provider.compressed.CompressedFileFileObject
SIZE_UNDEFINED
-
Fields inherited from class org.apache.commons.vfs2.provider.AbstractFileObject
DEFAULT_BUFFER_SIZE
-
Fields inherited from interface org.apache.commons.vfs2.FileObject
EMPTY_ARRAY
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Bzip2FileObject(AbstractFileName name, FileObject container, Bzip2FileSystem fs)
protected
Bzip2FileObject(AbstractFileName name, FileObject container, CompressedFileFileSystem fs)
Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static Bzip2FileSystem
cast(CompressedFileFileSystem fs)
protected java.io.InputStream
doGetInputStream(int bufferSize)
Creates an input stream to read the file content from.protected java.io.OutputStream
doGetOutputStream(boolean bAppend)
Creates an output stream to write the file content to.static java.io.InputStream
wrapInputStream(java.lang.String name, java.io.InputStream inputStream)
-
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, compareTo, copyFrom, createFolder, delete, delete, deleteAll, doAttach, doCreateFileContent, doCreateFolder, doDelete, doDetach, doGetAttributes, doGetCertificates, doGetInputStream, 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, 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
getPath, getURI
-
-
-
-
Constructor Detail
-
Bzip2FileObject
@Deprecated protected Bzip2FileObject(AbstractFileName name, FileObject container, CompressedFileFileSystem fs)
Deprecated.Deprecated since 2.1.- Parameters:
name
- Abstract file name.container
- My container.fs
- My file system.
-
Bzip2FileObject
protected Bzip2FileObject(AbstractFileName name, FileObject container, Bzip2FileSystem fs)
-
-
Method Detail
-
doGetInputStream
protected java.io.InputStream doGetInputStream(int bufferSize) throws java.lang.Exception
Description copied from class:AbstractFileObject
Creates an input stream to read the file content from. Is only called ifAbstractFileObject.doGetType()
returnsFileType.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.
- Overrides:
doGetInputStream
in classAbstractFileObject<Bzip2FileSystem>
- Parameters:
bufferSize
- Buffer size hint.- Returns:
- An InputStream to read the file content.
- Throws:
java.lang.Exception
- if an error occurs.
-
wrapInputStream
public static java.io.InputStream wrapInputStream(java.lang.String name, java.io.InputStream inputStream) throws java.io.IOException
- Throws:
java.io.IOException
-
doGetOutputStream
protected java.io.OutputStream doGetOutputStream(boolean bAppend) throws java.lang.Exception
Description copied from class:AbstractFileObject
Creates an output stream to write the file content to. Is only called if:AbstractFileObject.doIsWriteable()
returns true.AbstractFileObject.doGetType()
returnsFileType.FILE
, orAbstractFileObject.doGetType()
returnsFileType.IMAGINARY
, and the file's parent exists and is a folder.
The returned stream does not have to be buffered.
This implementation throws an exception.
- Overrides:
doGetOutputStream
in classAbstractFileObject<Bzip2FileSystem>
- 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:
java.lang.Exception
- if an error occurs.
-
cast
private static Bzip2FileSystem cast(CompressedFileFileSystem fs)
-
-