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