Package org.codehaus.plexus.archiver.zip
Class AbstractZipUnArchiver
- java.lang.Object
-
- org.codehaus.plexus.logging.AbstractLogEnabled
-
- org.codehaus.plexus.archiver.AbstractUnArchiver
-
- org.codehaus.plexus.archiver.zip.AbstractZipUnArchiver
-
- All Implemented Interfaces:
FinalizerEnabled
,UnArchiver
,org.codehaus.plexus.logging.LogEnabled
- Direct Known Subclasses:
ZipUnArchiver
public abstract class AbstractZipUnArchiver extends AbstractUnArchiver
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
AbstractZipUnArchiver.ZipEntryFileInfo
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
encoding
private long
maxOutputSize
private static java.lang.String
NATIVE_ENCODING
-
Fields inherited from interface org.codehaus.plexus.archiver.UnArchiver
ROLE
-
-
Constructor Summary
Constructors Constructor Description AbstractZipUnArchiver()
AbstractZipUnArchiver(java.io.File sourceFile)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
execute()
protected void
execute(java.lang.String path, java.io.File outputDirectory)
private java.lang.String
resolveSymlink(org.apache.commons.compress.archivers.zip.ZipFile zf, org.apache.commons.compress.archivers.zip.ZipArchiveEntry ze)
void
setEncoding(java.lang.String encoding)
Sets the encoding to assume for file names and comments.void
setMaxOutputSize(long maxOutputSize)
Set maximum allowed size of the produced output.-
Methods inherited from class org.codehaus.plexus.archiver.AbstractUnArchiver
addArchiveFinalizer, extract, extract, extractFile, getDestDirectory, getDestFile, getFileMappers, getFileSelectors, getSourceFile, isIgnorePermissions, isOverwrite, isSelected, isUseJvmChmod, setArchiveFinalizers, setDestDirectory, setDestFile, setFileMappers, setFileSelectors, setIgnorePermissions, setOverwrite, setSourceFile, setUseJvmChmod, validate, validate
-
-
-
-
Field Detail
-
NATIVE_ENCODING
private static final java.lang.String NATIVE_ENCODING
- See Also:
- Constant Field Values
-
encoding
private java.lang.String encoding
-
maxOutputSize
private long maxOutputSize
-
-
Method Detail
-
setEncoding
public void setEncoding(java.lang.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:
java.lang.IllegalArgumentException
- if specified output size is less or equal to 0
-
execute
protected void execute() throws ArchiverException
- Specified by:
execute
in classAbstractUnArchiver
- Throws:
ArchiverException
-
resolveSymlink
private java.lang.String resolveSymlink(org.apache.commons.compress.archivers.zip.ZipFile zf, org.apache.commons.compress.archivers.zip.ZipArchiveEntry ze) throws java.io.IOException
- Throws:
java.io.IOException
-
execute
protected void execute(java.lang.String path, java.io.File outputDirectory) throws ArchiverException
- Specified by:
execute
in classAbstractUnArchiver
- Throws:
ArchiverException
-
-