net.sweetohm.ant.util
Class FileTask

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by net.sweetohm.ant.util.FileTask
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
BshTask, InsertTask, LinkTask, MergeTask, NestTask, SplitTask, ValidTask, WordCountTask, XTask

public abstract class FileTask
extends org.apache.tools.ant.Task

This is the ancestor of all the file related tasks. It manages file and dir attributes and fileset nested elements.

Author:
Michel CASABIANCA

Field Summary
(package private)  java.lang.String dir
          The coma separated list of directories to process
(package private)  java.lang.String file
          The coma separated list of files to process
(package private)  java.util.Vector filesets
          The Vector of filesets to process
 
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
 
Constructor Summary
FileTask()
           
 
Method Summary
 void addFileset(org.apache.tools.ant.types.FileSet fileset)
          Fileset nested element.
 java.util.Vector getFiles(boolean strict)
          Return the list of files to process.
 void setDir(java.lang.String dir)
          Dir attribute.
 void setFile(java.lang.String file)
          File attribute.
 
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, execute, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

file

java.lang.String file
The coma separated list of files to process


dir

java.lang.String dir
The coma separated list of directories to process


filesets

java.util.Vector filesets
The Vector of filesets to process

Constructor Detail

FileTask

public FileTask()
Method Detail

setFile

public void setFile(java.lang.String file)
File attribute. This is a coma separated list of files to process.

Parameters:
file - The coma separated list of files to process.

setDir

public void setDir(java.lang.String dir)
Dir attribute. This is a coma separated list of directories to process. All the files in the directory are processed. Subdirectories are not scanned.

Parameters:
dir - The coma separated list of directories to process.

addFileset

public void addFileset(org.apache.tools.ant.types.FileSet fileset)
Fileset nested element. The fileset is added to the list.

Parameters:
fileset - The fileset to add.

getFiles

public java.util.Vector getFiles(boolean strict)
                          throws org.apache.tools.ant.BuildException
Return the list of files to process. This is a Vector built from the files, directories and filesets of the task.

Parameters:
strict - A flag that indicates if we should check that at least one file or directory is set. If false, the files and directories are checked anyway.
Returns:
A Vector of Files.
Throws:
org.apache.tools.ant.BuildException