Modifier and Type | Field and Description |
---|---|
static String |
ERROR_MULTIPLE_MAPPERS
Error message when more that one mapper is defined
|
static String |
NATIVE_ENCODING |
Modifier | Constructor and Description |
---|---|
|
Expand()
Creates an Expand instance and sets encoding to UTF-8.
|
protected |
Expand(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,
File srcF,
File dir)
This method is to be overridden by extending unarchival tasks.
|
protected void |
expandResource(Resource srcR,
File dir)
This method is to be overridden by extending unarchival tasks.
|
protected void |
extractFile(FileUtils fileUtils,
File srcF,
File dir,
InputStream compressedInputStream,
String entryName,
Date entryDate,
boolean isDirectory,
FileNameMapper mapper)
extract a file to a directory
|
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(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 |
setDest(File d)
Set the destination directory.
|
void |
setEncoding(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(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 String ERROR_MULTIPLE_MAPPERS
public static final String NATIVE_ENCODING
public Expand()
protected Expand(String encoding)
public void add(FileNameMapper fileNameMapper)
fileNameMapper
- the mapper to addpublic void add(ResourceCollection rc)
rc
- a resource collection.public void addFileset(FileSet set)
set
- a file setpublic void addPatternset(PatternSet set)
set
- a pattern setpublic Mapper createMapper() throws BuildException
BuildException
- if more than one mapper is definedpublic void execute() throws BuildException
execute
in class Task
BuildException
- Thrown in unrecoverable error.protected void expandFile(FileUtils fileUtils, File srcF, File dir)
fileUtils
- the fileUtilssrcF
- the source filedir
- the destination directoryprotected void expandResource(Resource srcR, File dir)
srcR
- the source resourcedir
- the destination directoryprotected void extractFile(FileUtils fileUtils, File srcF, File dir, InputStream compressedInputStream, String entryName, Date entryDate, boolean isDirectory, FileNameMapper mapper) throws 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 useIOException
- on errorpublic String getEncoding()
public boolean getFailOnEmptyArchive()
protected FileNameMapper getMapper()
public boolean getScanForUnicodeExtraFields()
protected void internalSetEncoding(String encoding)
protected void internalSetScanForUnicodeExtraFields(boolean b)
public void setDest(File d)
d
- Path to the directory.public void setEncoding(String encoding)
Set to native-encoding
if you want your
platform's native encoding, defaults to UTF8.
encoding
- the name of the character encodingpublic void setFailOnEmptyArchive(boolean b)
public void setOverwrite(boolean b)
b
- a boolean
valuepublic void setScanForUnicodeExtraFields(boolean b)
public void setSrc(File s)
s
- Path to zip-file.public void setStripAbsolutePathSpec(boolean b)