source: other-projects/trunk/realistic-books/packages/AntInstaller/web/manual/manual/CoreTypes/fileset.html@ 19253

Last change on this file since 19253 was 19253, checked in by davidb, 15 years ago

Establishing a source code repository for Veronica's Realistic Book's software

File size: 6.4 KB
Line 
1<!--
2 Licensed to the Apache Software Foundation (ASF) under one or more
3 contributor license agreements. See the NOTICE file distributed with
4 this work for additional information regarding copyright ownership.
5 The ASF licenses this file to You under the Apache License, Version 2.0
6 (the "License"); you may not use this file except in compliance with
7 the License. You may obtain a copy of the License at
8
9 http://www.apache.org/licenses/LICENSE-2.0
10
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
16-->
17<html>
18
19<head>
20<meta http-equiv="Content-Language" content="en-us">
21<link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
22<title>FileSet Type</title>
23</head>
24
25<body>
26
27<h2><a name="fileset">FileSet</a></h2>
28<p>A FileSet is a group of files. These files can be found in a
29directory tree starting in a base directory and are matched by
30patterns taken from a number of <a
31href="patternset.html">PatternSets</a> and
32<a href="selectors.html">Selectors</a>.
33<p>PatternSets can be specified as nested
34<code>&lt;patternset&gt;</code> elements. In addition, FileSet holds
35an implicit PatternSet and supports the nested
36<code>&lt;include&gt;</code>, <code>&lt;includesfile&gt;</code>,
37<code>&lt;exclude&gt;</code> and <code>&lt;excludesfile&gt;</code>
38elements of PatternSet directly, as well as PatternSet's
39attributes.</p>
40<p>Selectors are available as nested elements within the FileSet.
41If any of the selectors within the FileSet do not select the file, the
42file is not considered part of the FileSet. This makes a FileSet
43equivalent to an <code>&lt;and&gt;</code> selector container.</p>
44<table border="1" cellpadding="2" cellspacing="0">
45 <tr>
46 <td valign="top"><b>Attribute</b></td>
47 <td valign="top"><b>Description</b></td>
48 <td align="center" valign="top"><b>Required</b></td>
49 </tr>
50 <tr>
51 <td valign="top">dir</td>
52 <td valign="top">the root of the directory tree of this FileSet.</td>
53 <td valign="middle" align="center" rowspan="2">Either dir or file must be specified</td>
54 </tr>
55 <tr>
56 <td valign="top">file</td>
57 <td valign="top">shortcut for specifying a single-file fileset</td>
58 </tr>
59 <tr>
60 <td valign="top">defaultexcludes</td>
61 <td valign="top">indicates whether <a href="../dirtasks.html#defaultexcludes">default excludes</a> should be used or not
62 (<code>yes | no</code>); default excludes are used when omitted.</td>
63 <td valign="top" align="center">No</td>
64 </tr>
65 <tr>
66 <td valign="top">includes</td>
67 <td valign="top">comma- or space-separated list of patterns of files that must be
68 included; all files are included when omitted.</td>
69 <td valign="top" align="center">No</td>
70 </tr>
71 <tr>
72 <td valign="top">includesfile</td>
73 <td valign="top">the name of a file; each line of this file is
74 taken to be an include pattern.</td>
75 <td valign="top" align="center">No</td>
76 </tr>
77 <tr>
78 <td valign="top">excludes</td>
79 <td valign="top">comma- or space-separated list of patterns of files that must be
80 excluded; no files (except default excludes) are excluded when omitted.</td>
81 <td valign="top" align="center">No</td>
82 </tr>
83 <tr>
84 <td valign="top">excludesfile</td>
85 <td valign="top">the name of a file; each line of this file is
86 taken to be an exclude pattern.</td>
87 <td valign="top" align="center">No</td>
88 </tr>
89 <tr>
90 <td valign="top">casesensitive</td>
91 <td valign="top">Must the include and exclude patterns be treated in a case sensitive way?
92 Defaults to true.</td>
93 <td valign="top" align="center">No</td>
94 </tr>
95 <tr>
96 <td valign="top">followsymlinks</td>
97 <td valign="top">Shall symbolic links be followed? Defaults to
98 true. See the note <a href="#symlink">below</a>.</td>
99 <td valign="top" align="center">No</td>
100 </tr>
101</table>
102
103<p><a name="symlink"><b>Note</b></a>: All files/directories for which
104the canonical path is different from its path are considered symbolic
105links. On Unix systems this usually means the file really is a
106symbolic link but it may lead to false results on other
107platforms.</p>
108
109<h3>Examples</h3>
110<blockquote><pre>
111&lt;fileset dir=&quot;${server.src}&quot; casesensitive=&quot;yes&quot;&gt;
112 &lt;include name=&quot;**/*.java&quot;/&gt;
113 &lt;exclude name=&quot;**/*Test*&quot;/&gt;
114&lt;/fileset&gt;
115</pre></blockquote>
116<p>Groups all files in directory <code>${server.src}</code> that are Java
117source files and don't have the text <code>Test</code> in their
118name.</p>
119
120<blockquote><pre>
121&lt;fileset dir=&quot;${server.src}&quot; casesensitive=&quot;yes&quot;&gt;
122 &lt;patternset id=&quot;non.test.sources&quot;&gt;
123 &lt;include name=&quot;**/*.java&quot;/&gt;
124 &lt;exclude name=&quot;**/*Test*&quot;/&gt;
125 &lt;/patternset&gt;
126&lt;/fileset&gt;
127</pre></blockquote>
128<p>Groups the same files as the above example, but also establishes
129a PatternSet that can be referenced in other
130<code>&lt;fileset&gt;</code> elements, rooted at a different directory.</p>
131
132<blockquote><pre>
133&lt;fileset dir=&quot;${client.src}&quot; &gt;
134 &lt;patternset refid=&quot;non.test.sources&quot;/&gt;
135&lt;/fileset&gt;
136</pre></blockquote>
137<p>Groups all files in directory <code>${client.src}</code>, using the
138same patterns as the above example.</p>
139
140<blockquote><pre>
141&lt;fileset dir=&quot;${server.src}&quot; casesensitive=&quot;yes&quot;&gt;
142 &lt;filename name=&quot;**/*.java&quot;/&gt;
143 &lt;filename name=&quot;**/*Test*&quot; negate=&quot;true&quot;/&gt;
144&lt;/fileset&gt;
145</pre></blockquote>
146<p>Groups the same files as the top example, but using the
147<code>&lt;filename&gt;</code> selector.</p>
148
149<blockquote><pre>
150&lt;fileset dir=&quot;${server.src}&quot; casesensitive=&quot;yes&quot;&gt;
151 &lt;filename name=&quot;**/*.java&quot;/&gt;
152 &lt;not&gt;
153 &lt;filename name=&quot;**/*Test*&quot;/&gt;
154 &lt;/not&gt;
155&lt;/fileset&gt;
156</pre></blockquote>
157<p>Groups the same files as the previous example using a combination of the
158<code>&lt;filename&gt;</code> selector and the <code>&lt;not&gt;</code>
159selector container.</p>
160
161<blockquote><pre>
162&lt;fileset dir="src" includes="main/" /&gt;
163</pre></blockquote>
164<p>Selects all files in <i>src/main</i> (e.g. <i>src/main/Foo.java</i> or
165<i>src/main/application/Bar.java</i>).</p>
166
167
168
169</body>
170</html>
171
Note: See TracBrowser for help on using the repository browser.