Class Archive
java.lang.Object
org.apache.commons.compress.harmony.unpack200.Archive
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.-
Constructor Summary
ConstructorDescriptionArchive
(InputStream inputStream, JarOutputStream outputStream) Creates an Archive with streams for the input and output files.Creates an Archive with the given input and output file names. -
Method Summary
Modifier and TypeMethodDescriptionvoid
setDeflateHint
(boolean deflateHint) void
setLogFile
(String logFileName) void
setLogFile
(String logFileName, boolean append) void
setQuiet
(boolean quiet) void
setRemovePackFile
(boolean removePackFile) If removePackFile is set to true, the input file is deleted after unpacking.void
setVerbose
(boolean verbose) void
unpack()
Unpacks the Archive from the input file to the output file
-
Constructor Details
-
Archive
Creates an Archive with streams for the input and output files. Note: If you use this method then callingsetRemovePackFile(boolean)
will have no effect.- Parameters:
inputStream
- the input stream, preferably aBoundedInputStream
. The bound can the the file size.outputStream
- the JAR output stream.- Throws:
IOException
- if an I/O error occurs
-
Archive
public Archive(String inputFileName, String outputFileName) throws FileNotFoundException, IOException Creates an Archive with the given input and output file names.- Parameters:
inputFileName
- the input file name.outputFileName
- the output file name- Throws:
FileNotFoundException
- if the input file does not existIOException
- if an I/O error occurs
-
-
Method Details
-
setDeflateHint
-
setLogFile
- Throws:
FileNotFoundException
-
setLogFile
- Throws:
FileNotFoundException
-
setQuiet
-
setRemovePackFile
If removePackFile is set to true, the input file is deleted after unpacking.- Parameters:
removePackFile
- If true, the input file is deleted after unpacking.
-
setVerbose
-
unpack
Unpacks the Archive from the input file to the output file- Throws:
Pack200Exception
- TODOIOException
- TODO
-