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