Package org.apache.tools.ant.types
Class FileList
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.types.DataType
org.apache.tools.ant.types.FileList
- All Implemented Interfaces:
Cloneable
,Iterable<Resource>
,ResourceCollection
FileList represents an explicitly named list of files. FileLists
are useful when you want to capture a list of files regardless of
whether they currently exist. By contrast, FileSet operates as a
filter, only returning the name of a matched file if it currently
exists in the file system.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Inner class corresponding to the <file> nested element. -
Field Summary
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a nested <file> nested element.String[]
Returns the list of files represented by this FileList.boolean
Always returns true.iterator()
Fulfill the ResourceCollection contract.void
Set the dir attribute.void
Set the filenames attribute.void
Makes this instance in effect a reference to another FileList instance.int
size()
Fulfill the ResourceCollection contract.Methods inherited from class org.apache.tools.ant.types.DataType
checkAttributesAllowed, checkChildrenAllowed, circularReference, clone, dieOnCircularReference, dieOnCircularReference, dieOnCircularReference, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getDataTypeName, getRefid, invokeCircularReferenceCheck, isChecked, isReference, noChildrenAllowed, pushAndInvokeCircularReferenceCheck, setChecked, tooManyAttributes, toString
Methods inherited from class org.apache.tools.ant.ProjectComponent
getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface org.apache.tools.ant.types.ResourceCollection
isEmpty, stream
-
Constructor Details
-
FileList
public FileList()The default constructor. -
FileList
-
-
Method Details
-
setRefid
Makes this instance in effect a reference to another FileList instance.You must not set another attribute or nest elements inside this element if you make it a reference.
- Overrides:
setRefid
in classDataType
- Parameters:
r
- the reference to another filelist.- Throws:
BuildException
- if an error occurs.
-
setDir
Set the dir attribute.- Parameters:
dir
- the directory this filelist is relative to.- Throws:
BuildException
- if an error occurs
-
getDir
-
setFiles
Set the filenames attribute.- Parameters:
filenames
- a string containing filenames, separated by comma or by whitespace.
-
getFiles
-
addConfiguredFile
Add a nested <file> nested element.- Parameters:
name
- a configured file element with a name.- Since:
- Ant 1.6.2
-
iterator
-
size
public int size()Fulfill the ResourceCollection contract.- Specified by:
size
in interfaceResourceCollection
- Returns:
- number of elements as int.
- Since:
- Ant 1.7
-
isFilesystemOnly
public boolean isFilesystemOnly()Always returns true.- Specified by:
isFilesystemOnly
in interfaceResourceCollection
- Returns:
- true indicating that all elements will be FileResources.
- Since:
- Ant 1.7
-