Class AbstractZipUnArchiver

java.lang.Object
org.codehaus.plexus.archiver.AbstractUnArchiver
org.codehaus.plexus.archiver.zip.AbstractZipUnArchiver
All Implemented Interfaces:
FinalizerEnabled, UnArchiver
Direct Known Subclasses:
ZipUnArchiver

public abstract class AbstractZipUnArchiver extends AbstractUnArchiver
  • Field Details

    • NATIVE_ENCODING

      private static final String NATIVE_ENCODING
      See Also:
    • encoding

      private String encoding
    • maxOutputSize

      private long maxOutputSize
  • Constructor Details

    • AbstractZipUnArchiver

      public AbstractZipUnArchiver()
    • AbstractZipUnArchiver

      public AbstractZipUnArchiver(File sourceFile)
  • Method Details

    • setEncoding

      public void setEncoding(String encoding)
      Sets the encoding to assume for file names and comments.

      Set to native-encoding if you want your platform's native encoding, defaults to UTF8.

    • setMaxOutputSize

      public void setMaxOutputSize(long maxOutputSize)
      Set maximum allowed size of the produced output. It may be used as a protection against zip bombs.
      Parameters:
      maxOutputSize - max size of the produced output, in bytes. Must be greater than 0
      Throws:
      IllegalArgumentException - if specified output size is less or equal to 0
    • execute

      protected void execute() throws ArchiverException
      Specified by:
      execute in class AbstractUnArchiver
      Throws:
      ArchiverException
    • resolveSymlink

      private String resolveSymlink(org.apache.commons.compress.archivers.zip.ZipFile zf, org.apache.commons.compress.archivers.zip.ZipArchiveEntry ze) throws IOException
      Throws:
      IOException
    • execute

      protected void execute(String path, File outputDirectory) throws ArchiverException
      Specified by:
      execute in class AbstractUnArchiver
      Throws:
      ArchiverException