You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

filter.html 2.9 KiB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. -->
  15. <html>
  16. <head>
  17. <meta http-equiv="Content-Language" content="en-us">
  18. <link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
  19. <title>Filter Task</title>
  20. </head>
  21. <body>
  22. <h2><a name="filter">Filter</a></h2>
  23. <h3>Description</h3>
  24. <p>Sets a token filter for this project or read multiple token filter from
  25. an input file and sets these as filters.
  26. Token filters are used by all tasks that perform file copying operations
  27. through the Project commodity methods. See the warning
  28. <a href="../using.html#filters"><em>here</em></a> before using.</p>
  29. <p>Note 1: the token string must not contain the separators chars (@).<br>
  30. Note 2: Either token and value attributes must be provided, or only the
  31. filtersfile attribute.</p>
  32. <h3>Parameters</h3>
  33. <table border="1" cellpadding="2" cellspacing="0">
  34. <tr>
  35. <td valign="top"><b>Attribute</b></td>
  36. <td valign="top"><b>Description</b></td>
  37. <td align="center" valign="top"><b>Required</b></td>
  38. </tr>
  39. <tr>
  40. <td valign="top">token</td>
  41. <td valign="top">the token string without @</td>
  42. <td align="center" valign="top">Yes*</td>
  43. </tr>
  44. <tr>
  45. <td valign="top">value</td>
  46. <td valign="top">the string that should be put to replace the token when the
  47. file is copied</td>
  48. <td align="center" valign="top">Yes*</td>
  49. </tr>
  50. <tr>
  51. <td valign="top">filtersfile</td>
  52. <td valign="top">The file from which the filters must be read. This file must be a formatted as a property file. </td>
  53. <td align="center" valign="top">Yes*</td>
  54. </tr>
  55. </table>
  56. <p>* see notes 1 and 2 above parameters table.</p>
  57. <h3>Examples</h3>
  58. <pre> &lt;filter token=&quot;year&quot; value=&quot;2000&quot;/&gt;
  59. &lt;copy todir=&quot;${dest.dir}&quot; filtering=&quot;true&quot;&gt;
  60. &lt;fileset dir=&quot;${src.dir}&quot;/&gt;
  61. &lt;/copy&gt;</pre>
  62. <p>will copy recursively all the files from the <i>src.dir</i> directory into
  63. the <i>dest.dir</i> directory replacing all the occurrences of the string <i>@year@</i>
  64. with <i>2000.</i></p>
  65. <pre> &lt;filter filtersfile=&quot;deploy_env.properties&quot;/&gt;</pre>
  66. will read all property entries from the <i>deploy_env.properties</i> file
  67. and set these as filters.
  68. </body>
  69. </html>