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.

loadproperties.html 1.8 KiB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <html>
  2. <head>
  3. <title>LoadProperties Task</title>
  4. </head>
  5. <body>
  6. <h2><a name="loadproperties">LoadProperties</a></h2>
  7. <h3>Description</h3>
  8. <p>
  9. Load a file's contents as Ant properties. This is equivalent
  10. to &lt;property file=&quot;...&quot;/&gt; except that it
  11. supports nested &lt;filterchain&gt; elements.
  12. </p>
  13. <p>If you want to simulate <a href="property.html">property</a>'s
  14. prefix attribute, please use <a
  15. href="../CoreTypes/filterchain.html#prefixlines">prefixlines</a>
  16. filter.</p>
  17. <h3>Parameters</h3>
  18. <table border="1" cellpadding="2" cellspacing="0">
  19. <tr>
  20. <td valign="top"><b>Attribute</b></td>
  21. <td valign="top"><b>Description</b></td>
  22. <td align="center" valign="top"><b>Required</b></td>
  23. </tr>
  24. <tr>
  25. <td valign="top">srcFile</td>
  26. <td valign="top">source file</td>
  27. <td valign="top" align="center">Yes</td>
  28. </tr>
  29. <tr>
  30. <td valign="top">encoding</td>
  31. <td valign="top">encoding to use when loading the file</td>
  32. <td align="center" valign="top">No</td>
  33. </tr>
  34. </table>
  35. <p>
  36. The LoadProperties task supports nested <a href="../CoreTypes/filterchain.html">
  37. FilterChain</a>s.
  38. <h3>Examples</h3>
  39. <pre> &lt;loadproperties srcFile="file.properties"/&gt;
  40. </pre>
  41. Load contents of file.properties as Ant properties.
  42. <pre> &lt;loadproperties srcFile="file.properties"&gt;
  43. &lt;filterchain&gt;
  44. &lt;<a href="../CoreTypes/filterchain.html#linecontains">linecontains</a>&gt;
  45. &lt;contains value=&quot;import.&quot;/&gt;
  46. &lt;/linecontains&gt;
  47. &lt;/filterchain&gt;
  48. &lt;/loadproperties&gt;
  49. </pre>
  50. Read the lines that contain the string &quot;import.&quot;
  51. from the file &quot;file.properties&quot; and load them as
  52. Ant properties.
  53. <hr>
  54. <p align="center">Copyright &copy; 2002-2003 Apache Software Foundation. All rights
  55. Reserved.</p>
  56. </body>
  57. </html>