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.

unzip.html 3.7 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Language" content="en-us">
  4. <title>Unzip Task</title>
  5. </head>
  6. <body>
  7. <h2><a name="unzip">Unjar/Untar/Unwar/Unzip</a></h2>
  8. <h3>Description</h3>
  9. <p>Unzips a zip-, war-, tar- or jarfile.</p>
  10. <p>For JDK 1.1 &quot;last modified time&quot; field is set to current time instead of being
  11. carried from the archive file.</p>
  12. <p><a href="../CoreTypes/patternset.html">PatternSet</a>s are used to select files to extract
  13. <I>from</I> the archive. If no patternset is used, all files are extracted.
  14. </p>
  15. <p><a href="../CoreTypes/fileset.html">FileSet</a>s may be used used to select archived files
  16. to perform unarchival upon.
  17. </p>
  18. <p>File permissions will not be restored on extracted files.</p>
  19. <p>The untar task recognizes the long pathname entries used by GNU tar.<p>
  20. <h3>Parameters</h3>
  21. <table border="1" cellpadding="2" cellspacing="0">
  22. <tr>
  23. <td valign="top"><b>Attribute</b></td>
  24. <td valign="top"><b>Description</b></td>
  25. <td align="center" valign="top"><b>Required</b></td>
  26. </tr>
  27. <tr>
  28. <td valign="top">src</td>
  29. <td valign="top">archive file to expand.</td>
  30. <td align="center" valign="top">Yes, if filesets are not used.</td>
  31. </tr>
  32. <tr>
  33. <td valign="top">dest</td>
  34. <td valign="top">directory where to store the expanded files.</td>
  35. <td align="center" valign="top">Yes</td>
  36. </tr>
  37. <tr>
  38. <td valign="top">overwrite</td>
  39. <td valign="top">Overwrite files, even if they are newer than the
  40. corresponding entries in the archive (true or false, default is
  41. true).</td>
  42. <td align="center" valign="top">No</td>
  43. </tr>
  44. <tr>
  45. <td valign="top">compression</td>
  46. <td valign="top"><b>Note:</b> This attribute is only available for
  47. the <code>untar</code> task.<br>
  48. compression method. Allowable values are &quot;none&quot;,
  49. &quot;gzip&quot; and &quot;bzip2&quot;. Default is
  50. &quot;none&quot;.</td>
  51. <td valign="top" align="center">No</td>
  52. </tr>
  53. <tr>
  54. <td valign="top">encoding</td>
  55. <td valign="top"><b>Note:</b> This attribute is not available for
  56. the <code>untar</code> task.<br>
  57. The character encoding that has been used for filenames
  58. inside the zip file. For a list of possible values see <a
  59. href="http://java.sun.com/products/jdk/1.2/docs/guide/internat/encoding.doc.html">http://java.sun.com/products/jdk/1.2/docs/guide/internat/encoding.doc.html</a>.<br>
  60. Defaults to &quot;UTF8&quot;, use the magic value
  61. <code>native-encoding</code> for the platform's default character
  62. encoding.</td>
  63. <td align="center" valign="top">No</td>
  64. </tr>
  65. </table>
  66. <h3>Examples</h3>
  67. <blockquote>
  68. <p><code>&lt;unzip src=&quot;${tomcat_src}/tools-src.zip&quot; dest=&quot;${tools.home}&quot;/&gt;</code></p>
  69. </blockquote>
  70. <blockquote>
  71. <p><code>
  72. &lt;gunzip src=&quot;tools.tar.gz&quot;/&gt;<br>
  73. &lt;untar src=&quot;tools.tar&quot; dest=&quot;${tools.home}&quot;/&gt;
  74. </code></p>
  75. </blockquote>
  76. <blockquote>
  77. <p><pre>
  78. &lt;unzip src=&quot;${tomcat_src}/tools-src.zip&quot;
  79. dest=&quot;${tools.home}&quot;&gt;
  80. &lt;patternset&gt;
  81. &lt;include name=&quot;**/*.java&quot;/&gt;
  82. &lt;exclude name=&quot;**/Test*.java&quot;/&gt;
  83. &lt;/patternset&gt;
  84. &lt;/unzip&gt;
  85. </pre></p>
  86. </blockquote>
  87. <blockquote>
  88. <p><pre>
  89. &lt;unzip dest=&quot;${tools.home}&quot;&gt;
  90. &lt;patternset&gt;
  91. &lt;include name=&quot;**/*.java&quot;/&gt;
  92. &lt;exclude name=&quot;**/Test*.java&quot;/&gt;
  93. &lt;/patternset&gt;
  94. &lt;fileset dir=&quot;.&quot;&gt;
  95. &lt;include name=&quot;**/*.zip&quot;/&gt;
  96. &lt;exclude name=&quot;**/tmp*.zip&quot;/&gt;
  97. &lt;/fileset&gt;
  98. &lt;/unzip&gt;
  99. </pre></p>
  100. </blockquote>
  101. <hr>
  102. <p align="center">Copyright &copy; 2000-2003 Apache Software Foundation. All rights
  103. Reserved.</p>
  104. </body>
  105. </html>