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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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-, or jar file.</p>
  10. <p><a href="../CoreTypes/patternset.html">PatternSet</a>s are used to select files to extract
  11. <I>from</I> the archive. If no patternset is used, all files are extracted.
  12. </p>
  13. <p><a href="../CoreTypes/fileset.html">FileSet</a>s may be used to select archived files
  14. to perform unarchival upon.
  15. </p>
  16. <p>You can define filename transformations by using a nested <a href="../CoreTypes/mapper.html">mapper</a> element. The default mapper is the
  17. <a href="../CoreTypes/mapper.html#identity-mapper">identity mapper</a>.
  18. </p>
  19. <p>File permissions will not be restored on extracted files.</p>
  20. <p>The untar task recognizes the long pathname entries used by GNU tar.<p>
  21. <h3>Parameters</h3>
  22. <table border="1" cellpadding="2" cellspacing="0">
  23. <tr>
  24. <td valign="top"><b>Attribute</b></td>
  25. <td valign="top"><b>Description</b></td>
  26. <td align="center" valign="top"><b>Required</b></td>
  27. </tr>
  28. <tr>
  29. <td valign="top">src</td>
  30. <td valign="top">archive file to expand.</td>
  31. <td align="center" valign="top">Yes, if filesets are not used.</td>
  32. </tr>
  33. <tr>
  34. <td valign="top">dest</td>
  35. <td valign="top">directory where to store the expanded files.</td>
  36. <td align="center" valign="top">Yes</td>
  37. </tr>
  38. <tr>
  39. <td valign="top">overwrite</td>
  40. <td valign="top">Overwrite files, even if they are newer than the
  41. corresponding entries in the archive (true or false, default is
  42. true).</td>
  43. <td align="center" valign="top">No</td>
  44. </tr>
  45. <tr>
  46. <td valign="top">compression</td>
  47. <td valign="top"><b>Note:</b> This attribute is only available for
  48. the <code>untar</code> task.<br>
  49. compression method. Allowable values are &quot;none&quot;,
  50. &quot;gzip&quot; and &quot;bzip2&quot;. Default is
  51. &quot;none&quot;.</td>
  52. <td valign="top" align="center">No</td>
  53. </tr>
  54. <tr>
  55. <td valign="top">encoding</td>
  56. <td valign="top"><b>Note:</b> This attribute is not available for
  57. the <code>untar</code> task.<br>
  58. The character encoding that has been used for filenames
  59. inside the zip file. For a list of possible values see <a
  60. 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>
  61. Defaults to &quot;UTF8&quot;, use the magic value
  62. <code>native-encoding</code> for the platform's default character
  63. encoding.</td>
  64. <td align="center" valign="top">No</td>
  65. </tr>
  66. </table>
  67. <h3>Examples</h3>
  68. <blockquote>
  69. <p><code>&lt;unzip src=&quot;${tomcat_src}/tools-src.zip&quot; dest=&quot;${tools.home}&quot;/&gt;</code></p>
  70. </blockquote>
  71. <blockquote>
  72. <p><code>
  73. &lt;gunzip src=&quot;tools.tar.gz&quot;/&gt;<br>
  74. &lt;untar src=&quot;tools.tar&quot; dest=&quot;${tools.home}&quot;/&gt;
  75. </code></p>
  76. </blockquote>
  77. <blockquote>
  78. <p><pre>
  79. &lt;unzip src=&quot;${tomcat_src}/tools-src.zip&quot;
  80. dest=&quot;${tools.home}&quot;&gt;
  81. &lt;patternset&gt;
  82. &lt;include name=&quot;**/*.java&quot;/&gt;
  83. &lt;exclude name=&quot;**/Test*.java&quot;/&gt;
  84. &lt;/patternset&gt;
  85. &lt;/unzip&gt;
  86. </pre></p>
  87. </blockquote>
  88. <blockquote>
  89. <p><pre>
  90. &lt;unzip dest=&quot;${tools.home}&quot;&gt;
  91. &lt;patternset&gt;
  92. &lt;include name=&quot;**/*.java&quot;/&gt;
  93. &lt;exclude name=&quot;**/Test*.java&quot;/&gt;
  94. &lt;/patternset&gt;
  95. &lt;fileset dir=&quot;.&quot;&gt;
  96. &lt;include name=&quot;**/*.zip&quot;/&gt;
  97. &lt;exclude name=&quot;**/tmp*.zip&quot;/&gt;
  98. &lt;/fileset&gt;
  99. &lt;/unzip&gt;
  100. </pre></p>
  101. </blockquote>
  102. <blockquote>
  103. <p><pre>
  104. &lt;unzip src=&quot;apache-ant-bin.zip&quot; dest=&quot;${tools.home}&quot;&gt;
  105. &lt;patternset&gt;
  106. &lt;include name=&quot;apache-ant/lib/ant.jar&quot;/&gt;
  107. &lt;/patternset&gt;
  108. &lt;mapper type=&quot;flatten&quot;/&gt;
  109. &lt;/unzip&gt;
  110. </pre></p>
  111. </blockquote>
  112. <hr>
  113. <p align="center">Copyright &copy; 2000-2005 The Apache Software Foundation. All rights
  114. Reserved.</p>
  115. </body>
  116. </html>