java.lang.Object
org.apache.commons.compress.harmony.unpack200.Archive

public class Archive extends Object
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

    Constructors
    Constructor
    Description
    Archive(InputStream inputStream, JarOutputStream outputStream)
    Creates an Archive with streams for the input and output files.
    Archive(String inputFileName, String outputFileName)
    Creates an Archive with the given input and output file names.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    setDeflateHint(boolean deflateHint)
    Sets the default hint.
    void
    setLogFile(String logFileName)
    Sets the lgg file.
    void
    setLogFile(String logFileName, boolean append)
    Sets the lgg file.
    void
    setQuiet(boolean quiet)
    Sets whether to set the log level to quiet.
    void
    setRemovePackFile(boolean removePackFile)
    If removePackFile is set to true, the input file is deleted after unpacking.
    void
    setVerbose(boolean verbose)
    Sets whether to set the log level to verbose.
    void
    Unpacks the Archive from the input file to the output file.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • setDeflateHint

      public void setDeflateHint(boolean deflateHint)
      Sets the default hint.
      Parameters:
      deflateHint - the hint value.
    • setLogFile

      public void setLogFile(String logFileName) throws FileNotFoundException
      Sets the lgg file.
      Parameters:
      logFileName - the log file name.
      Throws:
      FileNotFoundException - if the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason
    • setLogFile

      public void setLogFile(String logFileName, boolean append) throws FileNotFoundException
      Sets the lgg file.
      Parameters:
      logFileName - the log file name.
      append - if true, then bytes will be written to the end of the file rather than the beginning
      Throws:
      FileNotFoundException - if the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason
    • setQuiet

      public void setQuiet(boolean quiet)
      Sets whether to set the log level to quiet.
      Parameters:
      quiet - whether to set the log level to quiet.
    • setRemovePackFile

      public void setRemovePackFile(boolean removePackFile)
      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

      public void setVerbose(boolean verbose)
      Sets whether to set the log level to verbose.
      Parameters:
      verbose - whether to set the log level to verbose.
    • unpack

      public void unpack() throws Pack200Exception, IOException
      Unpacks the Archive from the input file to the output file.
      Throws:
      Pack200Exception - Never thrown.
      IOException - if an I/O error has occurred.