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
|
---|
32 | the same as <i>src</i> (with the ".gz" or ".bz2"
|
---|
33 | extension removed if present). If <i>dest</i> is omitted, the parent
|
---|
34 | dir of <i>src</i> is taken. The file is only expanded if the source
|
---|
35 | resource is newer than the destination file, or when the destination file
|
---|
36 | does 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
|
---|
59 | resource collection</h4>
|
---|
60 |
|
---|
61 | <p>The specified resource will be used as src.</p>
|
---|
62 |
|
---|
63 | <h3>Examples</h3>
|
---|
64 | <blockquote><pre>
|
---|
65 | <gunzip src="test.tar.gz"/>
|
---|
66 | </pre></blockquote>
|
---|
67 | <p>expands <i>test.tar.gz</i> to <i>test.tar</i></p>
|
---|
68 | <blockquote><pre>
|
---|
69 | <bunzip2 src="test.tar.bz2"/>
|
---|
70 | </pre></blockquote>
|
---|
71 | <p>expands <i>test.tar.bz2</i> to <i>test.tar</i></p>
|
---|
72 | <blockquote><pre>
|
---|
73 | <gunzip src="test.tar.gz" dest="test2.tar"/>
|
---|
74 | </pre></blockquote>
|
---|
75 | <p>expands <i>test.tar.gz</i> to <i>test2.tar</i></p>
|
---|
76 | <blockquote><pre>
|
---|
77 | <gunzip src="test.tar.gz" dest="subdir"/>
|
---|
78 | </pre></blockquote>
|
---|
79 | <p>expands <i>test.tar.gz</i> to <i>subdir/test.tar</i> (assuming
|
---|
80 | subdir is a directory).</p>
|
---|
81 | <blockquote><pre>
|
---|
82 | <gunzip dest=".">
|
---|
83 | <url url="http://example.org/archive.tar.gz"/>
|
---|
84 | </gunzip>
|
---|
85 | </pre></blockquote>
|
---|
86 | <p>downloads <i>http://example.org/archive.tar.gz</i> and expands it
|
---|
87 | to <i>archive.tar</i> in the project's basedir on the fly.</p>
|
---|
88 |
|
---|
89 | <h3>Related tasks</h3>
|
---|
90 |
|
---|
91 | <pre>
|
---|
92 | <gunzip src="some-archive.gz" dest="some-dest-dir"/>
|
---|
93 | </pre>
|
---|
94 |
|
---|
95 | is identical to
|
---|
96 |
|
---|
97 | <pre>
|
---|
98 | <copy todir="some-dest-dir">
|
---|
99 | <gzipresource>
|
---|
100 | <file file="some-archive.gz"/>
|
---|
101 | </gzipresource>
|
---|
102 | <mapper type="glob" from="*.gz" to="*"/>
|
---|
103 | </copy>
|
---|
104 | </pre>
|
---|
105 |
|
---|
106 | <p>The same is also true for <code><bunzip2></code> and
|
---|
107 | <code><bzip2resource></code>. <code><copy></code> offers
|
---|
108 | additional features like <a
|
---|
109 | href="../CoreTypes/filterchains.html">filtering files</a> on the fly,
|
---|
110 | allowing a file to be mapped to multiple destinations, preserving the
|
---|
111 | last modified time or a configurable file system timestamp
|
---|
112 | granularity.</p>
|
---|
113 |
|
---|
114 |
|
---|
115 |
|
---|
116 | </body>
|
---|
117 | </html>
|
---|