org.codehaus.plexus.archiver.tar
Class TarUnArchiver.UntarCompressionMethod

java.lang.Object
  extended by org.codehaus.plexus.archiver.util.EnumeratedAttribute
      extended by org.codehaus.plexus.archiver.tar.TarUnArchiver.UntarCompressionMethod
Enclosing class:
TarUnArchiver

public static final class TarUnArchiver.UntarCompressionMethod
extends EnumeratedAttribute

Valid Modes for Compression attribute to Untar Task


Field Summary
private static java.lang.String BZIP2
          BZIP2 compression
private static java.lang.String GZIP
          GZIP compression
private static java.lang.String NONE
          No compression
 
Fields inherited from class org.codehaus.plexus.archiver.util.EnumeratedAttribute
value
 
Constructor Summary
TarUnArchiver.UntarCompressionMethod()
          Constructor
TarUnArchiver.UntarCompressionMethod(java.lang.String method)
          Constructor
 
Method Summary
private  java.io.InputStream decompress(java.io.File file, java.io.InputStream istream)
          This method wraps the input stream with the corresponding decompression method
 java.lang.String[] getValues()
          Get valid enumeration values
 
Methods inherited from class org.codehaus.plexus.archiver.util.EnumeratedAttribute
containsValue, getIndex, getValue, indexOfValue, setValue, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NONE

private static final java.lang.String NONE
No compression

See Also:
Constant Field Values

GZIP

private static final java.lang.String GZIP
GZIP compression

See Also:
Constant Field Values

BZIP2

private static final java.lang.String BZIP2
BZIP2 compression

See Also:
Constant Field Values
Constructor Detail

TarUnArchiver.UntarCompressionMethod

public TarUnArchiver.UntarCompressionMethod()
Constructor


TarUnArchiver.UntarCompressionMethod

public TarUnArchiver.UntarCompressionMethod(java.lang.String method)
Constructor

Method Detail

getValues

public java.lang.String[] getValues()
Get valid enumeration values

Specified by:
getValues in class EnumeratedAttribute
Returns:
valid values

decompress

private java.io.InputStream decompress(java.io.File file,
                                       java.io.InputStream istream)
                                throws java.io.IOException,
                                       ArchiverException
This method wraps the input stream with the corresponding decompression method

Parameters:
file - provides location information for BuildException
istream - input stream
Returns:
input stream with on-the-fly decompression
Throws:
java.io.IOException - thrown by GZIPInputStream constructor
BuildException - thrown if bzip stream does not start with expected magic values
ArchiverException