Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ERROR_MULTIPLE_MAPPERS
Error message when more that one mapper is defined
|
static java.lang.String |
NATIVE_ENCODING |
description, location, project
Modifier | Constructor and Description |
---|---|
|
Expand()
Creates an Expand instance and sets encoding to UTF-8.
|
protected |
Expand(java.lang.String encoding)
Creates an Expand instance and sets the given encoding.
|
Modifier and Type | Method and Description |
---|---|
void |
add(FileNameMapper fileNameMapper)
A nested filenamemapper
|
void |
add(ResourceCollection rc)
Add a resource collection.
|
void |
addFileset(FileSet set)
Add a fileset
|
void |
addPatternset(PatternSet set)
Add a patternset.
|
Mapper |
createMapper()
Defines the mapper to map source entries to destination files.
|
void |
execute()
Do the work.
|
protected void |
expandFile(FileUtils fileUtils,
java.io.File srcF,
java.io.File dir)
This method is to be overridden by extending unarchival tasks.
|
protected void |
expandResource(Resource srcR,
java.io.File dir)
This method is to be overridden by extending unarchival tasks.
|
protected void |
extractFile(FileUtils fileUtils,
java.io.File srcF,
java.io.File dir,
java.io.InputStream compressedInputStream,
java.lang.String entryName,
java.util.Date entryDate,
boolean isDirectory,
FileNameMapper mapper)
extract a file to a directory
|
java.lang.Boolean |
getAllowFilesToEscapeDest()
Whether to allow the extracted file or directory to be outside of the dest directory.
|
java.lang.String |
getEncoding() |
boolean |
getFailOnEmptyArchive()
Whether try ing to expand an empty archive would be an error.
|
protected FileNameMapper |
getMapper()
get a mapper for a file
|
boolean |
getScanForUnicodeExtraFields() |
protected void |
internalSetEncoding(java.lang.String encoding)
Supports grand-children that want to support the attribute
where the child-class doesn't (i.e.
|
protected void |
internalSetScanForUnicodeExtraFields(boolean b)
Supports grand-children that want to support the attribute
where the child-class doesn't (i.e.
|
void |
setAllowFilesToEscapeDest(boolean b)
Whether to allow the extracted file or directory to be outside of the dest directory.
|
void |
setDest(java.io.File d)
Set the destination directory.
|
void |
setEncoding(java.lang.String encoding)
Sets the encoding to assume for file names and comments.
|
void |
setFailOnEmptyArchive(boolean b)
Whether try ing to expand an empty archive would be an error.
|
void |
setOverwrite(boolean b)
Should we overwrite files in dest, even if they are newer than
the corresponding entries in the archive?
|
void |
setScanForUnicodeExtraFields(boolean b)
Whether unicode extra fields will be used if present.
|
void |
setSrc(java.io.File s)
Set the path to zip-file.
|
void |
setStripAbsolutePathSpec(boolean b)
Whether leading path separators should be stripped.
|
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
public static final java.lang.String NATIVE_ENCODING
public static final java.lang.String ERROR_MULTIPLE_MAPPERS
public Expand()
protected Expand(java.lang.String encoding)
encoding
- Stringpublic void setFailOnEmptyArchive(boolean b)
b
- booleanpublic boolean getFailOnEmptyArchive()
public void execute() throws BuildException
execute
in class Task
BuildException
- Thrown in unrecoverable error.protected void expandFile(FileUtils fileUtils, java.io.File srcF, java.io.File dir)
fileUtils
- the fileUtilssrcF
- the source filedir
- the destination directoryprotected void expandResource(Resource srcR, java.io.File dir)
srcR
- the source resourcedir
- the destination directoryprotected FileNameMapper getMapper()
protected void extractFile(FileUtils fileUtils, java.io.File srcF, java.io.File dir, java.io.InputStream compressedInputStream, java.lang.String entryName, java.util.Date entryDate, boolean isDirectory, FileNameMapper mapper) throws java.io.IOException
fileUtils
- a fileUtils objectsrcF
- the source filedir
- the destination directorycompressedInputStream
- the input streamentryName
- the name of the entryentryDate
- the date of the entryisDirectory
- if this is true the entry is a directorymapper
- the filename mapper to usejava.io.IOException
- on errorpublic void setDest(java.io.File d)
d
- Path to the directory.public void setSrc(java.io.File s)
s
- Path to zip-file.public void setOverwrite(boolean b)
b
- a boolean
valuepublic void addPatternset(PatternSet set)
set
- a pattern setpublic void addFileset(FileSet set)
set
- a file setpublic void add(ResourceCollection rc)
rc
- a resource collection.public Mapper createMapper() throws BuildException
BuildException
- if more than one mapper is definedpublic void add(FileNameMapper fileNameMapper)
fileNameMapper
- the mapper to addpublic void setEncoding(java.lang.String encoding)
Set to native-encoding
if you want your
platform's native encoding, defaults to UTF8.
encoding
- the name of the character encodingprotected void internalSetEncoding(java.lang.String encoding)
encoding
- Stringpublic java.lang.String getEncoding()
public void setStripAbsolutePathSpec(boolean b)
b
- booleanpublic void setScanForUnicodeExtraFields(boolean b)
b
- booleanprotected void internalSetScanForUnicodeExtraFields(boolean b)
b
- booleanpublic boolean getScanForUnicodeExtraFields()
public void setAllowFilesToEscapeDest(boolean b)
b
- the flagpublic java.lang.Boolean getAllowFilesToEscapeDest()
null
if the flag hasn't been set explicitly,
otherwise the value set by the user.