TrueZIP 6.8.2

de.schlichtherle.io.archive.tar
Class TarGZipDriver

java.lang.Object
  extended by de.schlichtherle.io.archive.spi.AbstractArchiveDriver
      extended by de.schlichtherle.io.archive.tar.TarDriver
          extended by de.schlichtherle.io.archive.tar.TarGZipDriver
All Implemented Interfaces:
ArchiveDriver, Serializable

public class TarGZipDriver
extends TarDriver

An archive driver which builds TAR files compressed with GZIP. Instances of this class are immutable.

Since:
TrueZIP 6.0
Version:
$Id: TarGZipDriver.java 06f3ba684701 2010/11/04 01:15:55 christian $
Author:
Christian Schlichtherle
See Also:
Serialized Form

Nested Class Summary
static class TarGZipDriver.GZIPOutputStream
           
 
Nested classes/interfaces inherited from class de.schlichtherle.io.archive.spi.AbstractArchiveDriver
AbstractArchiveDriver.InconsistentCharsetSupportError
 
Field Summary
private static int BUFSIZE
           
static int DEFAULT_LEVEL
          The default compression level to use when writing a GZIP output stream, which is 9.
private  int level
           
private static long serialVersionUID
           
 
Fields inherited from class de.schlichtherle.io.archive.tar.TarDriver
DEFAULT_CHARSET, TEMP_FILE_PREFIX
 
Constructor Summary
TarGZipDriver()
          Equivalent to this(DEFAULT_CHARSET, null, null, DEFAULT_LEVEL).
TarGZipDriver(int level)
          Equivalent to this(DEFAULT_CHARSET, null, null, level).
TarGZipDriver(String charset)
          Equivalent to this(charset, null, null, DEFAULT_LEVEL).
TarGZipDriver(String charset, Icon openIcon, Icon closedIcon, int level)
          Constructs a new TAR.GZ driver.
 
Method Summary
protected  InputStream createInputStream(Archive archive, ReadOnlyFile rof)
          Returns a new InputStream to read the contents from the given ReadOnlyFile from.
protected  TarOutputArchive createTarOutputArchive(Archive archive, OutputStream out, TarInputArchive source)
           
 int getLevel()
          Returns the value of the property preambled which was provided to the constructor.
 
Methods inherited from class de.schlichtherle.io.archive.tar.TarDriver
createArchiveEntry, createInputArchive, createOutputArchive, createTarInputArchive
 
Methods inherited from class de.schlichtherle.io.archive.spi.AbstractArchiveDriver
ensureEncodable, getCharset, getClosedIcon, getEncoding, getOpenIcon
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.schlichtherle.io.archive.spi.ArchiveDriver
equals, hashCode
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

BUFSIZE

private static final int BUFSIZE
See Also:
Constant Field Values

DEFAULT_LEVEL

public static final int DEFAULT_LEVEL
The default compression level to use when writing a GZIP output stream, which is 9.

See Also:
Constant Field Values

level

private final int level
Constructor Detail

TarGZipDriver

public TarGZipDriver()
Equivalent to this(DEFAULT_CHARSET, null, null, DEFAULT_LEVEL).


TarGZipDriver

public TarGZipDriver(String charset)
Equivalent to this(charset, null, null, DEFAULT_LEVEL).


TarGZipDriver

public TarGZipDriver(int level)
Equivalent to this(DEFAULT_CHARSET, null, null, level).


TarGZipDriver

public TarGZipDriver(String charset,
                     Icon openIcon,
                     Icon closedIcon,
                     int level)
Constructs a new TAR.GZ driver.

Parameters:
level - The compression level to use when writing a GZIP output stream.
Throws:
IllegalArgumentException - If level is not in the range [1..9] and is not -1.
Method Detail

getLevel

public final int getLevel()
Returns the value of the property preambled which was provided to the constructor.


createInputStream

protected InputStream createInputStream(Archive archive,
                                        ReadOnlyFile rof)
                                 throws IOException
Description copied from class: TarDriver
Returns a new InputStream to read the contents from the given ReadOnlyFile from. Override this method in order to decorate the stream returned by the implementation in this class in order to have the driver read the TAR file from wrapper file formats such as GZIP or BZIP2.

Note that the returned stream should support marking for best performance and will always be closed early by TarDriver.createInputArchive(Archive, ReadOnlyFile).

Overrides:
createInputStream in class TarDriver
Throws:
IOException

createTarOutputArchive

protected TarOutputArchive createTarOutputArchive(Archive archive,
                                                  OutputStream out,
                                                  TarInputArchive source)
                                           throws IOException
Overrides:
createTarOutputArchive in class TarDriver
Throws:
IOException

TrueZIP 6.8.2

Copyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.