Top Description Fields Constructors Methods
org.apache.commons.compress.harmony.unpack200

public Class Archive

extends Object
Class Inheritance
Imports
java.io.BufferedInputStream, .BufferedOutputStream, .FileInputStream, .FileNotFoundException, .FileOutputStream, .IOException, .InputStream, .OutputStream, java.nio.file.Files, .Path, .Paths, java.util.jar.JarEntry, .JarInputStream, .JarOutputStream, java.util.zip.GZIPInputStream, org.apache.commons.compress.harmony.pack200.Pack200Exception, org.apache.commons.io.IOUtils, org.apache.commons.io.input.BoundedInputStream

Archive is the main entry point to unpack200. An archive is constructed with either two file names, a pack file and an output file name or an input stream and an output streams. Then unpack() is called, to unpack the pack200 archive.

Field Summary

Modifier and TypeField and Description
private boolean
private final Path
private final long
private BoundedInputStream
private FileOutputStream
private int
private static final int[]
private String
private final JarOutputStream
private boolean
private boolean

Constructor Summary

AccessConstructor and Description
public
Archive(final InputStream
the input stream, preferably a BoundedInputStream. The bound can the the file size.
inputStream
,
final JarOutputStream
the JAR output stream.
outputStream
)

Creates an Archive with streams for the input and output files.

public
Archive(final String
the input file name.
inputFileName
,
final String
the output file name
outputFileName
)

Creates an Archive with the given input and output file names.

Method Summary

Modifier and TypeMethod and Description
private boolean
available(final InputStream inputStream)

public void
setDeflateHint(final boolean deflateHint)

public void
setLogFile(final String logFileName)

public void
setLogFile(final String logFileName, final boolean append)

public void
setQuiet(final boolean quiet)

public void
setRemovePackFile(final boolean
If true, the input file is deleted after unpacking.
removePackFile
)

If removePackFile is set to true, the input file is deleted after unpacking.

public void
setVerbose(final boolean verbose)

public void
unpack()

Unpacks the Archive from the input file to the output file

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

deflateHintback to summary
private boolean deflateHint
inputPathback to summary
private final Path inputPath
inputSizeback to summary
private final long inputSize
inputStreamback to summary
private BoundedInputStream inputStream
logFileback to summary
private FileOutputStream logFile
logLevelback to summary
private int logLevel
MAGICback to summary
private static final int[] MAGIC
outputFileNameback to summary
private String outputFileName
outputStreamback to summary
private final JarOutputStream outputStream
overrideDeflateHintback to summary
private boolean overrideDeflateHint
removePackFileback to summary
private boolean removePackFile

Constructor Detail

Archiveback to summary
public Archive(final InputStream inputStream, final JarOutputStream outputStream) throws IOException

Creates an Archive with streams for the input and output files.

Note

If you use this method then calling setRemovePackFile(boolean) will have no effect.

Parameters
inputStream:InputStream

the input stream, preferably a BoundedInputStream. The bound can the the file size.

outputStream:JarOutputStream

the JAR output stream.

Exceptions
IOException:
if an I/O error occurs
Archiveback to summary
public Archive(final String inputFileName, final String outputFileName) throws FileNotFoundException, IOException

Creates an Archive with the given input and output file names.

Parameters
inputFileName:String

the input file name.

outputFileName:String

the output file name

Annotations
@SuppressWarnings:resource
Exceptions
FileNotFoundException:
if the input file does not exist
IOException:
if an I/O error occurs

Method Detail

availableback to summary
private boolean available(final InputStream inputStream) throws IOException
setDeflateHintback to summary
public void setDeflateHint(final boolean deflateHint)
setLogFileback to summary
public void setLogFile(final String logFileName) throws FileNotFoundException
setLogFileback to summary
public void setLogFile(final String logFileName, final boolean append) throws FileNotFoundException
setQuietback to summary
public void setQuiet(final boolean quiet)
setRemovePackFileback to summary
public void setRemovePackFile(final boolean removePackFile)

If removePackFile is set to true, the input file is deleted after unpacking.

Parameters
removePackFile:boolean

If true, the input file is deleted after unpacking.

setVerboseback to summary
public void setVerbose(final boolean verbose)
unpackback to summary
public void unpack() throws Pack200Exception, IOException

Unpacks the Archive from the input file to the output file

Exceptions
Pack200Exception:
TODO
IOException:
TODO