org.apache.tools.ant.taskdefs
Class Expand

java.lang.Object
  |
  +--org.apache.tools.ant.ProjectComponent
        |
        +--org.apache.tools.ant.Task
              |
              +--org.apache.tools.ant.taskdefs.Expand
Direct Known 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
 
Constructor Summary
Expand()
           
 
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, java.io.File srcF, java.io.File dir)
           
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)
           
 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 setOverwrite(boolean b)
          Should we overwrite files in dest, even if they are newer than the corresponding entries in the archive?
 void setSrc(java.io.File s)
          Set the path to zip-file.
 
Methods inherited from class org.apache.tools.ant.Task
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, setProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Expand

public Expand()
Method Detail

execute

public void execute()
             throws BuildException
Do the work.

Overrides:
execute in class Task
Throws:
BuildException - Thrown in unrecoverable error.

expandFile

protected void expandFile(FileUtils fileUtils,
                          java.io.File srcF,
                          java.io.File dir)

extractFile

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)
                    throws java.io.IOException
java.io.IOException

setDest

public void setDest(java.io.File d)
Set the destination directory. File will be unzipped into the destination directory.

Parameters:
d - Path to the directory.

setSrc

public void setSrc(java.io.File s)
Set the path to zip-file.

Parameters:
s - Path to zip-file.

setOverwrite

public void setOverwrite(boolean b)
Should we overwrite files in dest, even if they are newer than the corresponding entries in the archive?


addPatternset

public void addPatternset(PatternSet set)
Add a patternset


addFileset

public void addFileset(FileSet set)
Add a fileset


setEncoding

public void setEncoding(java.lang.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


Copyright 2000-2005 Apache Software Foundation. All Rights Reserved.