org.apache.tools.ant.taskdefs

Class Expand

Known Direct Subclasses:
Untar

public class Expand
extends Task

Unzip a file.
Since:
Ant 1.1

Field Summary

Fields inherited from class org.apache.tools.ant.Task

description, location, target, taskName, taskType, wrapper

Fields inherited from class org.apache.tools.ant.ProjectComponent

project

Method Summary

void
addFileset(FileSet set)
Add a fileset
void
addPatternset(PatternSet set)
Add a patternset
void
execute()
Do the work.
protected void
expandFile(FileUtils fileUtils, File srcF, File dir)
protected void
extractFile(FileUtils fileUtils, File srcF, File dir, InputStream compressedInputStream, String entryName, Date entryDate, boolean isDirectory)
void
setDest(File d)
Set the destination directory.
void
setEncoding(String encoding)
Sets the encoding to assume for file names and comments.
void
setOverwrite(boolean b)
Should we overwrite files in dest, even if they are newer than the corresponding entries in the archive?
void
setSrc(File s)
Set the path to zip-file.

Methods inherited from class org.apache.tools.ant.Task

execute, getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType

Methods inherited from class org.apache.tools.ant.ProjectComponent

getProject, log, log, setProject

Method Details

addFileset

public void addFileset(FileSet set)
Add a fileset

addPatternset

public void addPatternset(PatternSet set)
Add a patternset

execute

public void execute()
            throws BuildException
Do the work.
Overrides:
execute in interface Task
Throws:
BuildException - Thrown in unrecoverable error.

expandFile

protected void expandFile(FileUtils fileUtils,
                          File srcF,
                          File dir)

extractFile

protected void extractFile(FileUtils fileUtils,
                           File srcF,
                           File dir,
                           InputStream compressedInputStream,
                           String entryName,
                           Date entryDate,
                           boolean isDirectory)
            throws IOException

setDest

public void setDest(File d)
Set the destination directory. File will be unzipped into the destination directory.
Parameters:
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.

Since:
Ant 1.6

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.
Parameters:
s - Path to zip-file.

Copyright B) 2000-2008 Apache Software Foundation. All Rights Reserved.