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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <!--
  2. Licensed to the Apache Software Foundation (ASF) under one or more
  3. contributor license agreements. See the NOTICE file distributed with
  4. this work for additional information regarding copyright ownership.
  5. The ASF licenses this file to You under the Apache License, Version 2.0
  6. (the "License"); you may not use this file except in compliance with
  7. the License. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. -->
  15. <html>
  16. <head>
  17. <meta http-equiv="Content-Language" content="en-us">
  18. <link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
  19. <title>Get Task</title>
  20. </head>
  21. <body>
  22. <h2><a name="get">Get</a></h2>
  23. <h3>Description</h3>
  24. <p>Gets a file from a URL. When the verbose option is &quot;on&quot;, this task
  25. displays a '.' for every 100 Kb retrieved. Any URL schema supported by
  26. the runtime is valid here, including http:, ftp: and jar:;
  27. https: is only valid if the appropriate support is added to the pre-1.4 Java
  28. runtimes.
  29. </p>
  30. The <i>usetimestamp</i> option enables you to control downloads so that the remote file is
  31. only fetched if newer than the local copy. If there is no local copy, the download always takes
  32. place. When a file is downloaded, the timestamp of the downloaded file is set to the remote timestamp,
  33. if the JVM is Java1.2 or later.
  34. NB: This timestamp facility only works on downloads using the HTTP protocol.
  35. <p>
  36. A username and password can be specified, in which case basic 'slightly encoded
  37. plain text' authentication is used. This is only a secure authentication
  38. mechanism over an HTTPS link.
  39. <p>
  40. If you need to go through a firewall, use
  41. <a href="../OptionalTasks/setproxy.html">&lt;setproxy&gt;</a>
  42. to set up the proxy first.
  43. </p>
  44. <h3>Parameters</h3>
  45. <table border="1" cellpadding="2" cellspacing="0">
  46. <tr>
  47. <td valign="top"><b>Attribute</b></td>
  48. <td valign="top"><b>Description</b></td>
  49. <td align="center" valign="top"><b>Required</b></td>
  50. </tr>
  51. <tr>
  52. <td valign="top">src</td>
  53. <td valign="top">the URL from which to retrieve a file.</td>
  54. <td align="center" valign="top">Yes</td>
  55. </tr>
  56. <tr>
  57. <td valign="top">dest</td>
  58. <td valign="top">the file where to store the retrieved file.</td>
  59. <td align="center" valign="top">Yes</td>
  60. </tr>
  61. <tr>
  62. <td valign="top">verbose</td>
  63. <td valign="top">show verbose progress information (&quot;on&quot;/&quot;off&quot;).</td>
  64. <td align="center" valign="top">No; default "false"</td>
  65. </tr>
  66. <tr>
  67. <td valign="top">ignoreerrors</td>
  68. <td valign="top">Log errors but don't treat as fatal.</td>
  69. <td align="center" valign="top">No; default "false"</td>
  70. </tr>
  71. <tr>
  72. <td valign="top">usetimestamp</td>
  73. <td valign="top">conditionally download a file based on the timestamp of the
  74. local copy. HTTP only</td>
  75. <td align="center" valign="top">No; default "false"</td>
  76. </tr>
  77. <tr>
  78. <td valign="top">username</td>
  79. <td valign="top">username for 'BASIC' http authentication</td>
  80. <td align="center" valign="top">if password is set</td>
  81. </tr>
  82. <tr>
  83. <td valign="top">password</td>
  84. <td valign="top">password: required </td>
  85. <td align="center" valign="top">if username is set</td>
  86. </tr>
  87. </table>
  88. <h3>Examples</h3>
  89. <pre> &lt;get src=&quot;http://ant.apache.org/&quot; dest=&quot;help/index.html&quot;/&gt;</pre>
  90. <p>Gets the index page of http://ant.apache.org/, and stores it in the file <code>help/index.html</code>.</p>
  91. <pre> &lt;get src=&quot;http://www.apache.org/dist/ant/KEYS&quot;
  92. dest=&quot;KEYS&quot;
  93. verbose=&quot;true&quot;
  94. usetimestamp=&quot;true&quot;/&gt;</pre>
  95. <p>
  96. Gets the PGP keys of Ant's (current and past) release managers, if the local copy
  97. is missing or out of date. Uses the verbose option
  98. for progress information.
  99. </p>
  100. <pre> &lt;get src=&quot;https://insecure-bank.org/statement/user=1214&quot;
  101. dest=&quot;statement.html&quot;
  102. username="1214";
  103. password="secret"/&gt;</pre>
  104. <p>
  105. Fetches some file from a server with access control. Because https is being used the
  106. fact that basic auth sends passwords in plaintext is moot.
  107. </body>
  108. </html>