FileSet

FileSets are groups of files. These files can be found in a directory tree starting in a base directory and are matched by patterns taken from a number of PatternSets. FileSets can appear inside tasks that support this feature or at the same level as target - i.e., as children of project.

PatternSets can be specified as nested <patternset> elements. In addition, FileSet holds an implicit PatternSet and supports the nested <include>, <includesfile>, <exclude> and <excludesfile> elements of PatternSet directly, as well as PatternSet's attributes.

Attribute Description Required
dir the root of the directory tree of this FileSet. Yes
defaultexcludes indicates whether default excludes should be used or not (yes | no); default excludes are used when omitted. No
includes comma-separated list of patterns of files that must be included; all files are included when omitted. No
includesfile the name of a file; each line of this file is taken to be an include pattern. No
excludes comma-separated list of patterns of files that must be excluded; no files (except default excludes) are excluded when omitted. No
excludesfile the name of a file; each line of this file is taken to be an exclude pattern. No
casesensitive Must the file system be treated in a case sensitive way? Defaults to true. No

Examples

<fileset dir="${server.src}" casesensitive="yes" >
  <patternset id="non.test.sources" >
    <include name="**/*.java"/>
    <exclude name="**/*Test*"/>
  </patternset>
</fileset>

Groups all files in directory ${server.src} that are Java source files and don't have the text Test in their name.

<fileset dir="${client.src}" >
  <patternset refid="non.test.sources"/>
</fileset>

Groups all files in directory ${client.src}, using the same patterns as the example above.


Copyright © 2000,2001 Apache Software Foundation. All rights Reserved.