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

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