source: release-kits/lirk3/bin/ant-installer/web/manual/manual/CoreTasks/unpack.html@ 14982

Last change on this file since 14982 was 14982, checked in by oranfry, 16 years ago

initial import of LiRK3

File size: 3.8 KB
Line 
1<!--
2 Licensed to the Apache Software Foundation (ASF) under one or more
3 contributor license agreements. See the NOTICE file distributed with
4 this work for additional information regarding copyright ownership.
5 The ASF licenses this file to You under the Apache License, Version 2.0
6 (the "License"); you may not use this file except in compliance with
7 the License. You may obtain a copy of the License at
8
9 http://www.apache.org/licenses/LICENSE-2.0
10
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
16-->
17<html>
18
19<head>
20<meta http-equiv="Content-Language" content="en-us">
21<link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
22<title>GUnzip/BUnzip2 Task</title>
23</head>
24
25<body>
26
27<h2><a name="unpack">GUnzip/BUnzip2</a></h2>
28<h3>Description</h3>
29<p>Expands a resource packed using GZip or BZip2.</p>
30
31<p>If <i>dest</i> is a directory the name of the destination file is
32the same as <i>src</i> (with the &quot;.gz&quot; or &quot;.bz2&quot;
33extension removed if present). If <i>dest</i> is omitted, the parent
34dir of <i>src</i> is taken. The file is only expanded if the source
35resource is newer than the destination file, or when the destination file
36does not exist.</p>
37
38<h3>Parameters</h3>
39<table border="1" cellpadding="2" cellspacing="0">
40 <tr>
41 <td valign="top"><b>Attribute</b></td>
42 <td valign="top"><b>Description</b></td>
43 <td align="center" valign="top"><b>Required</b></td>
44 </tr>
45 <tr>
46 <td valign="top">src</td>
47 <td valign="top">the file to expand.</td>
48 <td align="center" valign="top">Yes, or a nested resource collection.</td>
49 </tr>
50 <tr>
51 <td valign="top">dest</td>
52 <td valign="top">the destination file or directory.</td>
53 <td align="center" valign="top">No</td>
54 </tr>
55</table>
56<h3>Parameters specified as nested elements</h3>
57
58<h4>any <a href="../CoreTypes/resources.html">resource</a> or single element
59resource collection</h4>
60
61<p>The specified resource will be used as src.</p>
62
63<h3>Examples</h3>
64<blockquote><pre>
65&lt;gunzip src=&quot;test.tar.gz&quot;/&gt;
66</pre></blockquote>
67<p>expands <i>test.tar.gz</i> to <i>test.tar</i></p>
68<blockquote><pre>
69&lt;bunzip2 src=&quot;test.tar.bz2&quot;/&gt;
70</pre></blockquote>
71<p>expands <i>test.tar.bz2</i> to <i>test.tar</i></p>
72<blockquote><pre>
73&lt;gunzip src=&quot;test.tar.gz&quot; dest=&quot;test2.tar&quot;/&gt;
74</pre></blockquote>
75<p>expands <i>test.tar.gz</i> to <i>test2.tar</i></p>
76<blockquote><pre>
77&lt;gunzip src=&quot;test.tar.gz&quot; dest=&quot;subdir&quot;/&gt;
78</pre></blockquote>
79<p>expands <i>test.tar.gz</i> to <i>subdir/test.tar</i> (assuming
80subdir is a directory).</p>
81<blockquote><pre>
82&lt;gunzip dest=&quot;.&quot;&gt;
83 &lt;url url="http://example.org/archive.tar.gz"/&gt;
84&lt;/gunzip&gt;
85</pre></blockquote>
86<p>downloads <i>http://example.org/archive.tar.gz</i> and expands it
87to <i>archive.tar</i> in the project's basedir on the fly.</p>
88
89<h3>Related tasks</h3>
90
91<pre>
92&lt;gunzip src="some-archive.gz" dest="some-dest-dir"/&gt;
93</pre>
94
95is identical to
96
97<pre>
98&lt;copy todir="some-dest-dir"&gt;
99 &lt;gzipresource&gt;
100 &lt;file file="some-archive.gz"/&gt;
101 &lt;/gzipresource&gt;
102 &lt;mapper type="glob" from="*.gz" to="*"/&gt;
103&lt;/copy&gt;
104</pre>
105
106<p>The same is also true for <code>&lt;bunzip2&gt;</code> and
107<code>&lt;bzip2resource&gt;</code>. <code>&lt;copy&gt;</code> offers
108additional features like <a
109href="../CoreTypes/filterchains.html">filtering files</a> on the fly,
110allowing a file to be mapped to multiple destinations, preserving the
111last modified time or a configurable file system timestamp
112granularity.</p>
113
114
115
116</body>
117</html>
Note: See TracBrowser for help on using the repository browser.