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.

unpack.html 3.1 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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>GUnzip/BUnzip2 Task</title>
  6. </head>
  7. <body>
  8. <h2><a name="unpack">GUnzip/BUnzip2</a></h2>
  9. <h3>Description</h3>
  10. <p>Expands a resource packed using GZip or BZip2.</p>
  11. <p>If <i>dest</i> is a directory the name of the destination file is
  12. the same as <i>src</i> (with the &quot;.gz&quot; or &quot;.bz2&quot;
  13. extension removed if present). If <i>dest</i> is omitted, the parent
  14. dir of <i>src</i> is taken. The file is only expanded if the source
  15. resource is newer than the destination file, or when the destination file
  16. does not exist.</p>
  17. <h3>Parameters</h3>
  18. <table border="1" cellpadding="2" cellspacing="0">
  19. <tr>
  20. <td valign="top"><b>Attribute</b></td>
  21. <td valign="top"><b>Description</b></td>
  22. <td align="center" valign="top"><b>Required</b></td>
  23. </tr>
  24. <tr>
  25. <td valign="top">src</td>
  26. <td valign="top">the file to expand.</td>
  27. <td align="center" valign="top">Yes, or a nested resource collection.</td>
  28. </tr>
  29. <tr>
  30. <td valign="top">dest</td>
  31. <td valign="top">the destination file or directory.</td>
  32. <td align="center" valign="top">No</td>
  33. </tr>
  34. </table>
  35. <h3>Parameters specified as nested elements</h3>
  36. <h4>any <a href="../CoreTypes/resources.html">resource</a> or single element
  37. resource collection</h4>
  38. <p>The specified resource will be used as src.</p>
  39. <h3>Examples</h3>
  40. <blockquote><pre>
  41. &lt;gunzip src=&quot;test.tar.gz&quot;/&gt;
  42. </pre></blockquote>
  43. <p>expands <i>test.tar.gz</i> to <i>test.tar</i></p>
  44. <blockquote><pre>
  45. &lt;bunzip2 src=&quot;test.tar.bz2&quot;/&gt;
  46. </pre></blockquote>
  47. <p>expands <i>test.tar.bz2</i> to <i>test.tar</i></p>
  48. <blockquote><pre>
  49. &lt;gunzip src=&quot;test.tar.gz&quot; dest=&quot;test2.tar&quot;/&gt;
  50. </pre></blockquote>
  51. <p>expands <i>test.tar.gz</i> to <i>test2.tar</i></p>
  52. <blockquote><pre>
  53. &lt;gunzip src=&quot;test.tar.gz&quot; dest=&quot;subdir&quot;/&gt;
  54. </pre></blockquote>
  55. <p>expands <i>test.tar.gz</i> to <i>subdir/test.tar</i> (assuming
  56. subdir is a directory).</p>
  57. <blockquote><pre>
  58. &lt;gunzip dest=&quot;.&quot;&gt;
  59. &lt;url url="http://example.org/archive.tar.gz"/&gt;
  60. &lt;/gunzip&gt;
  61. </pre></blockquote>
  62. <p>downloads <i>http://example.org/archive.tar.gz</i> and expands it
  63. to <i>archive.tar</i> in the project's basedir on the fly.</p>
  64. <h3>Related tasks</h3>
  65. <pre>
  66. &lt;gunzip src="some-archive.gz" dest="some-dest-dir"/&gt;
  67. </pre>
  68. is identical to
  69. <pre>
  70. &lt;copy todir="some-dest-dir"&gt;
  71. &lt;gzipresource&gt;
  72. &lt;file file="some-archive.gz"/&gt;
  73. &lt;/gzipresource&gt;
  74. &lt;mapper type="glob" from="*.gz" to="*"/&gt;
  75. &lt;/copy&gt;
  76. </pre>
  77. <p>The same is also true for <code>&lt;bunzip2&gt;</code> and
  78. <code>&lt;bzip2resource&gt;</code>. <code>&lt;copy&gt;</code> offers
  79. additional features like <a
  80. href="../CoreTypes/filterchains.html">filtering files</a> on the fly,
  81. allowing a file to be mapped to multiple destinations, preserving the
  82. last modified time or a configurable file system timestamp
  83. granularity.</p>
  84. <hr>
  85. <p align="center">Copyright &copy; 2000-2001,2004-2005 The Apache Software Foundation. All rights
  86. Reserved.</p>
  87. </body>
  88. </html>