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>Length Task</title>
|
---|
23 | </head>
|
---|
24 |
|
---|
25 | <body>
|
---|
26 |
|
---|
27 | <h2><a name="length">Length</a></h2>
|
---|
28 | <h3>Description</h3>
|
---|
29 | <p>Display or set a property containing length information for
|
---|
30 | a string, a file, or one or more nested
|
---|
31 | <a href="../CoreTypes/resources.html#collection">Resource Collection</a>s.
|
---|
32 | Can also be used as a condition. <b>Since Ant 1.6.3</b></p>
|
---|
33 | <h3>Parameters</h3>
|
---|
34 | <table border="1" cellpadding="2" cellspacing="0">
|
---|
35 | <tr>
|
---|
36 | <td valign="top"><b>Attribute</b></td>
|
---|
37 | <td valign="top"><b>Description</b></td>
|
---|
38 | <td align="center" valign="top"><b>Required</b></td>
|
---|
39 | </tr>
|
---|
40 | <tr>
|
---|
41 | <td valign="top">property</td>
|
---|
42 | <td valign="top">The property to set. If omitted
|
---|
43 | the results are written to the log. Ignored when
|
---|
44 | processing as a condition.</td>
|
---|
45 | <td valign="top" align="center">No</td>
|
---|
46 | </tr>
|
---|
47 | <tr>
|
---|
48 | <td valign="top">file</td>
|
---|
49 | <td valign="top">Single file whose length to report.</td>
|
---|
50 | <td valign="top" align="center" rowspan="2">One of these,
|
---|
51 | or one or more nested filesets</td>
|
---|
52 | </tr>
|
---|
53 | <tr>
|
---|
54 | <td valign="top">string</td>
|
---|
55 | <td valign="top">The string whose length to report.</td>
|
---|
56 | </tr>
|
---|
57 | <tr>
|
---|
58 | <td valign="top">mode</td>
|
---|
59 | <td valign="top">File length mode; when "all" the resulting
|
---|
60 | value is the sum of all included resources' lengths; when "each"
|
---|
61 | the task outputs the absolute path and length of each included resource,
|
---|
62 | one per line. Ignored when processing as a condition.</td>
|
---|
63 | <td valign="top" align="center">No; default is "all"</td>
|
---|
64 | </tr>
|
---|
65 | <tr>
|
---|
66 | <td valign="top">trim</td>
|
---|
67 | <td valign="top">Whether to trim when operating on a string.</td>
|
---|
68 | <td valign="top" align="center">No; only valid when string is set</td>
|
---|
69 | </tr>
|
---|
70 | <tr>
|
---|
71 | <td valign="top">length</td>
|
---|
72 | <td valign="top">Comparison length for processing as a condition.</td>
|
---|
73 | <td valign="top" align="center">Yes, in condition mode</td>
|
---|
74 | </tr>
|
---|
75 | <tr>
|
---|
76 | <td valign="top">when</td>
|
---|
77 | <td valign="top">Comparison type: "equal", "eq", "greater", "gt", "less",
|
---|
78 | "lt", "ge" (greater or equal), "ne" (not equal), "le" (less or equal)
|
---|
79 | for use when operating as a condition.</td>
|
---|
80 | <td valign="top" align="center">No; default is "equal"</td>
|
---|
81 | </tr>
|
---|
82 | </table>
|
---|
83 | <h3>Parameters specified as nested elements</h3>
|
---|
84 | <h4>Resource Collections</h4>
|
---|
85 | <p>You can include resources via nested
|
---|
86 | <a href="../CoreTypes/resources.html#collection">Resource Collection</a>s.</p>
|
---|
87 | <h3>Examples</h3>
|
---|
88 | <pre><length string="foo" property="length.foo" />
|
---|
89 | </pre>
|
---|
90 | <p>Stores the length of the string "foo" in the property named
|
---|
91 | <i>length.foo</i>.</p>
|
---|
92 | <pre><length file="bar" property="length.bar" />
|
---|
93 | </pre>
|
---|
94 | <p>Stores the length of file "bar" in the property named
|
---|
95 | <i>length.bar</i>.</p>
|
---|
96 |
|
---|
97 | </body>
|
---|
98 | </html>
|
---|
99 |
|
---|