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

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