1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Ant-contrib Tasks: TimestampSelector</title>
</head>
<body>
<h1>TimestampSelector</h1>
<p>The TimestampSelector task takes either a nested <path> element,
or a path reference, and sets either a named property, or a <code>path</code>
instance to absolute pathnames of the files with either the N latest or earliest
modification dates (based on the <code>age</code> attribute)</p>
<h2>Parameters</h2>
<table border="1" cellpadding="2" cellspacing="0">
<tr>
<th>Attribute</th>
<th>Description</th>
<th>Required</th>
</tr>
<tr>
<td valign="top">property</td>
<td valign="top">The property to set with the most recently modified file. Mutually
exclusive with the <code>outputsetid</code> attribute.</td>
<td align="center" valign="top">Yes, if <code>outputsetid</code> is not specified.</td>
</tr>
<tr>
<td valign="top">outputsetid</td>
<td valign="top">The id of a <code>path</code> instance which will contain the
resulting list of files. This id should not already exist. Mutually exclusive
with the <code>property</code> attribute</td>
<td align="center" valign="top">Yes, if <code>property</code> is note specified.</td>
</tr>
<tr>
<td valign="top">count</td>
<td valign="top">The number of files to find. If more than 1, than the
files in the output appear in the order indicated by the <code>age</code>
attribute.</td>
<td align="center" valign="top">No. Defaults to <code>1<code></td>
</tr>
<tr>
<td valign="top">age</td>
<td valign="top">The age of the files to retrieve, either <code>eldest</code>
or <code>youngest</code>. Defaults to <code>youngest</code>.</td>
<td align="center" valign="top">No. Defaults to <code>1<code></td>
</tr>
<tr>
<td valign="top">pathSep</td>
<td valign="top">The path separator to separate paths with when using the
<code>property</code> attribute in conjunction with the <code>count</code>
attribute</td>
<td align="center" valign="top">No. Defaults to <code>,<code></td>
</tr>
<tr>
<td valign="top">pathref</td>
<td valign="top">Id of the path to find the most recently modified file in.</td>
<td align="center" valign="top">No, if a <code>path</code> subelement is
specified.</td>
</tr>
</table>
<h2>Parameters specified as nested elements</h2>
<a name="path"><h3>path</h3></a>
<p><a href="http://ant.apache.org/manual/using.html#path">Path</a>
is used to select sets of files or directories in which to find the
most recently modified file</p>
<h2>Example</h2>
<h3>Using a path reference</h3>
<pre>
<code>
<path id="mypath">
<fileset dir="${log.dir}">
<include name="update*.log" />
</fileset>
<path>
<timestampselector property="most.recent.logs"
pathref="mypath" count="3"
pathsep=";" />
<echo message="${most.recent.logs}" />
</code>
</pre>
<h3>Using a nested <code>path</code> element</h3>
<pre>
<code>
<timestampselector property="most.recent.logs"
count="3"
pathsep=";" >
<path>
<fileset dir="${log.dir}">
<include name="update*.log" />
</fileset>
<path>
</timestampselector>
<echo message="${most.recent.logs}" />
</code>
</pre>
<h3>Outputing to a <code>path</code> element</h3>
<pre>
<code>
<timestampselector outputsetref="most.recent.logs"
pathref="mypath" count="3">
<path>
<fileset dir="${log.dir}">
<include name="update*.log" />
</fileset>
<path>
</timestampselector>
<copy todir="somedir">
<path refid="most.recent.logs" />
</copy>
</code>
</pre>
<hr>
<p align="center">Copyright © 2002-2003 Ant-Contrib Project. All
rights Reserved.</p>
</body>
</html>
|