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.7 KiB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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 and it cannot be
  12. specified outside a target.
  13. </p>
  14. <h3>Parameters</h3>
  15. <table border="1" cellpadding="2" cellspacing="0">
  16. <tr>
  17. <td valign="top"><b>Attribute</b></td>
  18. <td valign="top"><b>Description</b></td>
  19. <td align="center" valign="top"><b>Required</b></td>
  20. </tr>
  21. <tr>
  22. <td valign="top">srcFile</td>
  23. <td valign="top">source file</td>
  24. <td valign="top" align="center">Yes</td>
  25. </tr>
  26. <tr>
  27. <td valign="top">encoding</td>
  28. <td valign="top">encoding to use when loading the file</td>
  29. <td align="center" valign="top">No</td>
  30. </tr>
  31. </table>
  32. <p>
  33. The LoadProperties task supports nested <a href="../CoreTypes/filterchain.html">
  34. FilterChain</a>s.
  35. <h3>Examples</h3>
  36. <pre> &lt;loadproperties srcFile="file.properties"/&gt;
  37. </pre>
  38. Load contents of file.properties as Ant properties.
  39. <pre> &lt;loadproperties srcFile="file.properties"&gt;
  40. &lt;filterchain&gt;
  41. &lt;<a href="../CoreTypes/filterchain.html#linecontains">linecontains</a>&gt;
  42. &lt;contains value="import.&quot;/&gt;
  43. &lt;/linecontains&gt;
  44. &lt;/filterchain&gt;
  45. &lt;/loadproperties&gt;
  46. </pre>
  47. Read the lines that contain the string &quot;import.&quot;
  48. from the file &quot;file.properties&quot; and load them as
  49. Ant properties.
  50. <hr>
  51. <p align="center">Copyright &copy; 2002 Apache Software Foundation. All rights
  52. Reserved.</p>
  53. </body>
  54. </html>