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.

get.html 2.6 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Language" content="en-us">
  4. <title>Ant User Manual</title>
  5. </head>
  6. <body>
  7. <h2><a name="get">Get</a></h2>
  8. <h3>Description</h3>
  9. <p>Gets a file from a URL. When the verbose option is &quot;on&quot;, this task
  10. displays a '.' for every 100 Kb retrieved.</p>
  11. <p>This task should be preferred above the <a href="cvs.html">CVS task</a> when
  12. doing automated builds. CVS is significantly slower than loading a compressed
  13. archive with http/ftp.</p>
  14. The <i>usetimestamp</i> option enables you to control downloads so that the remote file is
  15. only fetched if newer than the local copy. If there is no local copy, the download always takes
  16. place. When a file is downloaded, the timestamp of the downloaded file is set to the remote timestamp,
  17. if the JVM is Java1.2 or later.
  18. NB: This timestamp facility only works on downloads using the HTTP protocol.
  19. <h3>Parameters</h3>
  20. <table border="1" cellpadding="2" cellspacing="0">
  21. <tr>
  22. <td valign="top"><b>Attribute</b></td>
  23. <td valign="top"><b>Description</b></td>
  24. <td align="center" valign="top"><b>Required</b></td>
  25. </tr>
  26. <tr>
  27. <td valign="top">src</td>
  28. <td valign="top">the URL from which to retrieve a file.</td>
  29. <td align="center" valign="top">Yes</td>
  30. </tr>
  31. <tr>
  32. <td valign="top">dest</td>
  33. <td valign="top">the file where to store the retrieved file.</td>
  34. <td align="center" valign="top">Yes</td>
  35. </tr>
  36. <tr>
  37. <td valign="top">verbose</td>
  38. <td valign="top">show verbose progress information (&quot;on&quot;/&quot;off&quot;).</td>
  39. <td align="center" valign="top">No</td>
  40. </tr>
  41. <tr>
  42. <td valign="top">ignoreerrors</td>
  43. <td valign="top">Log errors but don't treat as fatal.</td>
  44. <td align="center" valign="top">No</td>
  45. </tr>
  46. <tr>
  47. <td valign="top">usetimestamp</td>
  48. <td valign="top">conditionally download a file based on the timestamp of the local copy.
  49. HTTP only</td>
  50. <td align="center" valign="top">No</td>
  51. </tr>
  52. </table>
  53. <h3>Examples</h3>
  54. <pre> &lt;get src=&quot;http://jakarta.apache.org/&quot; dest=&quot;help/index.html&quot;/&gt;</pre>
  55. <p>Gets the index page of http://jakarta.apache.org/, and stores it in the file <code>help/index.html</code>.</p>
  56. <pre> &lt;get src=&quot;http://jakarta.apache.org/builds/tomcat/nightly/ant.zip&quot;
  57. dest=&quot;optional.jar&quot;
  58. verbose=&quot;true&quot;
  59. usetimestamp=&quot;true&quot;/&gt;</pre>
  60. <p>
  61. Gets the nightly ant build from the tomcat distribution, if the local copy
  62. is missing or out of date. Uses the verbose option
  63. for progress information.
  64. </p>
  65. <hr>
  66. <p align="center">Copyright &copy; 2000,2001 Apache Software Foundation. All rights
  67. Reserved.</p>
  68. </body>
  69. </html>