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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Language" content="en-us">
  4. <title>Get</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. Any URL schema supported by
  11. the runtime is valid here, including http:, ftp: and jar:;
  12. https: is only valid if the appropriate support is added to the pre-1.4 Java
  13. runtimes.
  14. </p>
  15. <p>This task should be preferred above the <a href="cvs.html">CVS task</a> when
  16. fetching remote content. CVS is significantly slower than loading a compressed
  17. archive compared to http/ftp.</p>
  18. The <i>usetimestamp</i> option enables you to control downloads so that the remote file is
  19. only fetched if newer than the local copy. If there is no local copy, the download always takes
  20. place. When a file is downloaded, the timestamp of the downloaded file is set to the remote timestamp,
  21. if the JVM is Java1.2 or later.
  22. NB: This timestamp facility only works on downloads using the HTTP protocol.
  23. <p>
  24. A username and password can be specified, in which case basic 'slightly encoded
  25. plain text' authentication is used. This is only a secure authentication
  26. mechanism over an HTTPS link.
  27. </p>
  28. <h3>Parameters</h3>
  29. <table border="1" cellpadding="2" cellspacing="0">
  30. <tr>
  31. <td valign="top"><b>Attribute</b></td>
  32. <td valign="top"><b>Description</b></td>
  33. <td align="center" valign="top"><b>Required</b></td>
  34. </tr>
  35. <tr>
  36. <td valign="top">src</td>
  37. <td valign="top">the URL from which to retrieve a file.</td>
  38. <td align="center" valign="top">Yes</td>
  39. </tr>
  40. <tr>
  41. <td valign="top">dest</td>
  42. <td valign="top">the file where to store the retrieved file.</td>
  43. <td align="center" valign="top">Yes</td>
  44. </tr>
  45. <tr>
  46. <td valign="top">verbose</td>
  47. <td valign="top">show verbose progress information (&quot;on&quot;/&quot;off&quot;).</td>
  48. <td align="center" valign="top">No; default "false"</td>
  49. </tr>
  50. <tr>
  51. <td valign="top">ignoreerrors</td>
  52. <td valign="top">Log errors but don't treat as fatal.</td>
  53. <td align="center" valign="top">No; default "false"</td>
  54. </tr>
  55. <tr>
  56. <td valign="top">usetimestamp</td>
  57. <td valign="top">conditionally download a file based on the timestamp of the
  58. local copy. HTTP only</td>
  59. <td align="center" valign="top">No; default "false"</td>
  60. </tr>
  61. <tr>
  62. <td valign="top">username</td>
  63. <td valign="top">username for 'BASIC' http authentication</td>
  64. <td align="center" valign="top">if password is set</td>
  65. </tr>
  66. <tr>
  67. <td valign="top">password</td>
  68. <td valign="top">password: required </td>
  69. <td align="center" valign="top">if username is set</td>
  70. </tr>
  71. </table>
  72. <h3>Examples</h3>
  73. <pre> &lt;get src=&quot;http://jakarta.apache.org/&quot; dest=&quot;help/index.html&quot;/&gt;</pre>
  74. <p>Gets the index page of http://jakarta.apache.org/, and stores it in the file <code>help/index.html</code>.</p>
  75. <pre> &lt;get src=&quot;http://jakarta.apache.org/builds/tomcat/nightly/ant.zip&quot;
  76. dest=&quot;optional.jar&quot;
  77. verbose=&quot;true&quot;
  78. usetimestamp=&quot;true&quot;/&gt;</pre>
  79. <p>
  80. Gets the nightly ant build from the tomcat distribution, if the local copy
  81. is missing or out of date. Uses the verbose option
  82. for progress information.
  83. </p>
  84. <pre> &lt;get src=&quot;https://insecure-bank.org/statement/user=1214&quot;
  85. dest=&quot;statement.html&quot;
  86. username="1214";
  87. password="secret" /&gt;</pre>
  88. <p>
  89. Fetches some file from a server with access control. Because https is being used the
  90. fact that basic auth sends passwords in plaintext is moot.
  91. <hr>
  92. <p align="center">Copyright &copy; 2001-2002 Apache Software Foundation. All rights
  93. Reserved.</p>
  94. </body>
  95. </html>