Unzip a file.
add
public void add(ResourceCollection rc)
Add a resource collection.
rc
- a resource collection.
add
public void add(FileNameMapper fileNameMapper)
A nested filenamemapper
fileNameMapper
- the mapper to add
addFileset
public void addFileset(FileSet set)
Add a fileset
addPatternset
public void addPatternset(PatternSet set)
Add a patternset.
createMapper
public Mapper createMapper()
throws BuildException
Defines the mapper to map source entries to destination files.
- a mapper to be configured
expandFile
protected void expandFile(FileUtils fileUtils,
File srcF,
File dir)
This method is to be overridden by extending unarchival tasks.
fileUtils
- the fileUtilssrcF
- the source filedir
- the destination directory
expandResource
protected void expandResource(Resource srcR,
File dir)
This method is to be overridden by extending unarchival tasks.
srcR
- the source resourcedir
- the destination directory
extractFile
protected void extractFile(FileUtils fileUtils,
File srcF,
File dir,
InputStream compressedInputStream,
String entryName,
Date entryDate,
boolean isDirectory,
FileNameMapper mapper)
throws IOException
extract a file to a directory
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 use
getMapper
protected FileNameMapper getMapper()
get a mapper for a file
- a filenamemapper for a file
setDest
public void setDest(File d)
Set the destination directory. File will be unzipped into the
destination directory.
d
- Path to the directory.
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.
encoding
- the name of the character encoding
setOverwrite
public void setOverwrite(boolean b)
Should we overwrite files in dest, even if they are newer than
the corresponding entries in the archive?
setSrc
public void setSrc(File s)
Set the path to zip-file.