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

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