View | Details | Raw Unified | Return to bug 12267
Collapse All | Expand All

(-)docs/manual/CoreTasks/unzip.html (-8 / +52 lines)
Lines 9-23 Link Here
9
9
10
<h2><a name="unzip">Unjar/Untar/Unwar/Unzip</a></h2>
10
<h2><a name="unzip">Unjar/Untar/Unwar/Unzip</a></h2>
11
<h3>Description</h3>
11
<h3>Description</h3>
12
<p>Unzips a zip-, war-, tar- or jarfile.</p>
12
<p>Unzips zip-, war-, tar- or jarfile(s).</p>
13
<p>For JDK 1.1 &quot;last modified time&quot; field is set to current time instead of being
13
<p>For JDK 1.1 &quot;last modified time&quot; field is set to current time instead of being
14
carried from the archive file.</p>
14
carried from the archive file.</p>
15
<p><a href="../CoreTypes/patternset.html">PatternSet</a>s are used to select files to extract
16
<I>from</I> the archive.  If no patternset is used, all files are extracted.
17
</p>
18
<p><a href="../CoreTypes/fileset.html">FileSet</a>s may be used used to select archived files
19
to perform unarchival upon.
20
</p>
21
<p>File permissions will not be restored on extracted files.</p>
15
<p>File permissions will not be restored on extracted files.</p>
22
<p>The untar task recognizes the long pathname entries used by GNU tar.<p>
16
<p>The untar task recognizes the long pathname entries used by GNU tar.<p>
23
<h3>Parameters</h3>
17
<h3>Parameters</h3>
Lines 53-68 Link Here
53
  </tr>
47
  </tr>
54
48
55
</table>
49
</table>
50
<h3>Parameters specified as nested elements</h3>
51
52
<h4>fileset</h4>
53
 <p><a href="../CoreTypes/fileset.html">FileSet</a>s may be used used to select archived files
54
 to perform unarchival upon.
55
 </p>
56
57
<h4>patternset</h4>
58
 <p><a href="../CoreTypes/patternset.html">PatternSet</a>s are used to select files to extract
59
 <I>from</I> the archive.  If no patternset is used, all files are extracted.
60
 </p>
61
62
<h4>mapper</h4>
63
 <p>A nested <a href="../CoreTypes/mapper.html">mapper</a> element can be used
64
 to map archive file names to extraction directories. The mapper will map the
65
 src or fileset file names to a directory name that is appended to dest to
66
 create the final destination directory. New directories will be created if they
67
 don't already exist. Unmatched archives will not be extracted. If no mapper is
68
 specified all of the archive files will be extracted into the single dest
69
 directory.</p>
70
56
<h3>Examples</h3>
71
<h3>Examples</h3>
57
<blockquote>
72
<blockquote>
58
  <p><code>&lt;unzip src=&quot;${tomcat_src}/tools-src.zip&quot; dest=&quot;${tools.home}&quot;/&gt;</code></p>
73
  <p><code>&lt;unzip src=&quot;${tomcat_src}/tools-src.zip&quot; dest=&quot;${tools.home}&quot;/&gt;</code></p>
59
</blockquote>
74
</blockquote>
75
<p>Unzips ${tomcat_src}/tools-src.zip into the ${tools.home} directory</p>
60
<blockquote>
76
<blockquote>
61
  <p><code>
77
  <p><code>
62
&lt;gunzip src=&quot;tools.tar.gz&quot;/&gt;<br>
78
&lt;gunzip src=&quot;tools.tar.gz&quot;/&gt;<br>
63
&lt;untar src=&quot;tools.tar&quot; dest=&quot;${tools.home}&quot;/&gt;
79
&lt;untar src=&quot;tools.tar&quot; dest=&quot;${tools.home}&quot;/&gt;
64
</code></p>
80
</code></p>
65
</blockquote>
81
</blockquote>
82
<p>Gunzips the tools.tar.gz file into tools.tar and untars that into the
83
${tools.home} directory</p>
66
<blockquote>
84
<blockquote>
67
<p><pre>
85
<p><pre>
68
&lt;unzip src=&quot;${tomcat_src}/tools-src.zip&quot;
86
&lt;unzip src=&quot;${tomcat_src}/tools-src.zip&quot;
Lines 74-79 Link Here
74
&lt;/unzip&gt;
92
&lt;/unzip&gt;
75
</pre></p>
93
</pre></p>
76
</blockquote>
94
</blockquote>
95
<p>Unzips any file in the ${tomcat_src}/tools-src.zip archive that ends with
96
".java", unless the file name starts with "Test", into the ${tools.home}
97
directory</p>
77
<blockquote>
98
<blockquote>
78
<p><pre>
99
<p><pre>
79
&lt;unzip dest=&quot;${tools.home}&quot;&gt;
100
&lt;unzip dest=&quot;${tools.home}&quot;&gt;
Lines 88-95 Link Here
88
&lt;/unzip&gt;
109
&lt;/unzip&gt;
89
</pre></p>
110
</pre></p>
90
</blockquote>
111
</blockquote>
112
<p>Unzips any file that ends with ".java", unless the file name starts with
113
"Test", into the ${tools.home} directory from any archive in the current
114
directory or subdirectories that ends in ".zip", but doesn't start with
115
"tmp".</p>
116
<blockquote>
117
<p><pre>&lt;unjar dest=&quot;${dir.preverified}&quot;&gt;
118
  &lt;fileset dir=&quot;${dir.src}&quot;&gt;
119
    &lt;include name=&quot;*.jar&quot; /&gt;
120
    &lt;include name=&quot;*.zip&quot; /&gt;
121
  &lt;/fileset&gt;
122
  &lt;mapper type=&quot;regexp&quot; from=&quot;^(.*)\.(jar|zip)$$&quot; to=&quot;\1/&quot; /&gt;
123
&lt;/unjar&gt;
124
</pre></p>
125
</blockquote>
126
127
<p>Unpacks all files ending in .jar or .zip in the ${dir.src} directory and puts
128
the contents of <em>each</em> into a subdirectory of the ${dir.preverified}
129
directory. Each subdirectory is named the same name as the original archive file
130
that its' contents came from, but without the trailing .jar or .zip. For
131
example, the contents of <code>src/purifier.zip</code> and
132
<code>src/ant.jar</code> will be extracted to <code>preverified/purifier/</code>
133
and <code>preverified/ant/</code> directories respectively.</p>
134
91
<hr>
135
<hr>
92
<p align="center">Copyright &copy; 2000-2002 Apache Software Foundation. All rights
136
<p align="center">Copyright &copy; 2000-2003 Apache Software Foundation. All rights
93
Reserved.</p>
137
Reserved.</p>
94
138
95
</body>
139
</body>

Return to bug 12267