FileLists are explicitly named lists of files. Whereas FileSets act as filters, returning only those files that exist in the file system and match specified patterns, FileLists are useful for specifying files that may or may not exist. Multiple files are specified as a list of files, relative to the specified directory, with no support for wildcard expansion (filenames with wildcards will be included in the list unchanged). FileLists can appear inside tasks that support this feature or as stand-alone types.
Attribute | Description | Required |
dir | The base directory of this FileList. | Yes |
files | The list of file names. This is a list of file name separated by whitespace, or by commas. | Yes, unless there is a nested file element |
This represents a file name. The nested element allows filenames containing white space and commas.
Since Apache Ant 1.6.2
Attribute | Description | Required |
name | The name of the file. | Yes |
<filelist id="docfiles" dir="${doc.src}" files="foo.xml,bar.xml"/>
The files ${doc.src}/foo.xml
and
${doc.src}/bar.xml
. Note that these files may not (yet)
actually exist.
<filelist id="docfiles" dir="${doc.src}" files="foo.xml bar.xml"/>
Same files as the example above.
<filelist refid="docfiles"/>
Same files as the example above.
<filelist id="docfiles" dir="${doc.src}"> <file name="foo.xml"/> <file name="bar.xml"/> </filelist>
Same files as the example above.