Package org.codehaus.groovy.ant
Class FileScanner
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.codehaus.groovy.ant.FileScanner
- All Implemented Interfaces:
Cloneable
public class FileScanner
extends org.apache.tools.ant.Task
FileScanner is a bean which allows the iteration
over a number of files from a collection of FileSet instances.
-
Field Summary
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapperFields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project -
Constructor Summary
ConstructorsConstructorDescriptionCreates a scanner with no associated project.FileScanner(org.apache.tools.ant.Project project) Creates a scanner bound to the supplied Ant project. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFileset(org.apache.tools.ant.types.FileSet set) Adds a set of files (nested fileset attribute).voidclear()Clears any file sets that have been added to this scannerReturns an iterator over the directories matched by the configured file sets.booleanhasFiles()Indicates whether any file sets have been configured.iterator()Returns an iterator over the files matched by the configured file sets.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, setTaskTypeMethods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
-
Constructor Details
-
FileScanner
public FileScanner()Creates a scanner with no associated project. -
FileScanner
public FileScanner(org.apache.tools.ant.Project project) Creates a scanner bound to the supplied Ant project.- Parameters:
project- the owning Ant project
-
-
Method Details
-
iterator
Returns an iterator over the files matched by the configured file sets.- Returns:
- an iterator across matched files
-
directories
Returns an iterator over the directories matched by the configured file sets.- Returns:
- an iterator across matched directories
-
hasFiles
public boolean hasFiles()Indicates whether any file sets have been configured.- Returns:
trueif at least one file set has been added
-
clear
public void clear()Clears any file sets that have been added to this scanner -
addFileset
public void addFileset(org.apache.tools.ant.types.FileSet set) Adds a set of files (nested fileset attribute).- Parameters:
set- the file set to add
-