public abstract class AbstractUnArchiver extends org.codehaus.plexus.logging.AbstractLogEnabled implements UnArchiver, FinalizerEnabled
ROLE
Constructor and Description |
---|
AbstractUnArchiver() |
AbstractUnArchiver(File sourceFile) |
Modifier and Type | Method and Description |
---|---|
void |
addArchiveFinalizer(ArchiveFinalizer finalizer) |
protected abstract void |
execute() |
protected abstract void |
execute(String path,
File outputDirectory) |
void |
extract()
Extract the archive.
|
void |
extract(String path,
File outputDirectory)
Take a path into the archive and extract it to the specified directory.
|
protected void |
extractFile(File srcF,
File dir,
InputStream compressedInputStream,
String entryName,
Date entryDate,
boolean isDirectory,
Integer mode,
String symlinkDestination,
org.codehaus.plexus.components.io.filemappers.FileMapper[] fileMappers) |
File |
getDestDirectory() |
File |
getDestFile() |
org.codehaus.plexus.components.io.filemappers.FileMapper[] |
getFileMappers()
Get chain of components which rewrite the target path of each unpacked file.
|
org.codehaus.plexus.components.io.fileselectors.FileSelector[] |
getFileSelectors()
Returns a set of
FileSelector instances, which may be used to select the files to extract from the
archive. |
File |
getSourceFile() |
boolean |
isIgnorePermissions() |
boolean |
isOverwrite()
Gets a flag indicating destination files are always overwritten.
|
protected boolean |
isSelected(String fileName,
org.codehaus.plexus.components.io.resources.PlexusIoResource fileInfo) |
boolean |
isUseJvmChmod() |
void |
setArchiveFinalizers(List archiveFinalizers) |
void |
setDestDirectory(File destDirectory) |
void |
setDestFile(File destFile) |
void |
setFileMappers(org.codehaus.plexus.components.io.filemappers.FileMapper[] fileMappers)
Sets chain of components to be used for rewriting target path of each unpacked file.
|
void |
setFileSelectors(org.codehaus.plexus.components.io.fileselectors.FileSelector[] fileSelectors)
Sets a set of
FileSelector instances, which may be used to select the files to extract from the archive. |
void |
setIgnorePermissions(boolean ignorePermissions) |
void |
setOverwrite(boolean b)
Should we overwrite files in dest, even if they are newer than the corresponding entries in the archive?
|
void |
setSourceFile(File sourceFile) |
void |
setUseJvmChmod(boolean useJvmChmod)
jvm chmod won't set group level permissions !
|
protected void |
validate() |
protected void |
validate(String path,
File outputDirectory) |
public AbstractUnArchiver()
public AbstractUnArchiver(File sourceFile)
public File getDestDirectory()
getDestDirectory
in interface UnArchiver
public void setDestDirectory(File destDirectory)
setDestDirectory
in interface UnArchiver
public File getDestFile()
getDestFile
in interface UnArchiver
public void setDestFile(File destFile)
setDestFile
in interface UnArchiver
public File getSourceFile()
getSourceFile
in interface UnArchiver
public void setSourceFile(File sourceFile)
setSourceFile
in interface UnArchiver
public boolean isOverwrite()
UnArchiver
isOverwrite
in interface UnArchiver
true
, if destination files are overwritten, even if they are newer than the corresponding entry
in the archive.public void setOverwrite(boolean b)
UnArchiver
setOverwrite
in interface UnArchiver
public org.codehaus.plexus.components.io.filemappers.FileMapper[] getFileMappers()
UnArchiver
getFileMappers
in interface UnArchiver
FileMapper
s to be used for rewriting each target path, or null
if no rewriting shall happen.public void setFileMappers(org.codehaus.plexus.components.io.filemappers.FileMapper[] fileMappers)
UnArchiver
setFileMappers
in interface UnArchiver
fileMappers
- FileMapper
to be used for rewriting each target path, or null
if no
rewriting shall happen.public final void extract() throws ArchiverException
UnArchiver
extract
in interface UnArchiver
ArchiverException
public final void extract(String path, File outputDirectory) throws ArchiverException
UnArchiver
extract
in interface UnArchiver
path
- Path inside the archive to be extracted.outputDirectory
- Directory to extract to.ArchiverException
public void addArchiveFinalizer(ArchiveFinalizer finalizer)
addArchiveFinalizer
in interface FinalizerEnabled
public void setArchiveFinalizers(List archiveFinalizers)
setArchiveFinalizers
in interface FinalizerEnabled
protected void validate() throws ArchiverException
ArchiverException
public void setFileSelectors(org.codehaus.plexus.components.io.fileselectors.FileSelector[] fileSelectors)
UnArchiver
FileSelector
instances, which may be used to select the files to extract from the archive.
If file selectors are present, then a file is only extracted, if it is confirmed by all file selectors.setFileSelectors
in interface UnArchiver
public org.codehaus.plexus.components.io.fileselectors.FileSelector[] getFileSelectors()
UnArchiver
FileSelector
instances, which may be used to select the files to extract from the
archive. If file selectors are present, then a file is only extracted, if it is confirmed by all file selectors.getFileSelectors
in interface UnArchiver
protected boolean isSelected(String fileName, org.codehaus.plexus.components.io.resources.PlexusIoResource fileInfo) throws ArchiverException
ArchiverException
protected abstract void execute() throws ArchiverException
ArchiverException
protected abstract void execute(String path, File outputDirectory) throws ArchiverException
ArchiverException
public boolean isUseJvmChmod()
isUseJvmChmod
in interface UnArchiver
public void setUseJvmChmod(boolean useJvmChmod)
setUseJvmChmod
in interface UnArchiver
public boolean isIgnorePermissions()
isIgnorePermissions
in interface UnArchiver
public void setIgnorePermissions(boolean ignorePermissions)
setIgnorePermissions
in interface UnArchiver
protected void extractFile(File srcF, File dir, InputStream compressedInputStream, String entryName, Date entryDate, boolean isDirectory, Integer mode, String symlinkDestination, org.codehaus.plexus.components.io.filemappers.FileMapper[] fileMappers) throws IOException, ArchiverException
IOException
ArchiverException
Copyright © 2001–2018 Codehaus Plexus. All rights reserved.