[14982] | 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 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
---|
| 18 | <html>
|
---|
| 19 | <head>
|
---|
| 20 | <meta http-equiv="Content-Language" content="en-us">
|
---|
| 21 | <link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
|
---|
| 22 | <title>ZipFileSet Type</title>
|
---|
| 23 | </head>
|
---|
| 24 | <body>
|
---|
| 25 | <h2><a name="fileset">ZipFileSet</a></h2>
|
---|
| 26 |
|
---|
| 27 | <p>A <code><zipfileset></code> is a special form of a <code><<a
|
---|
| 28 | href="fileset.html">fileset</a>></code> which can behave in 2
|
---|
| 29 | different ways : <br>
|
---|
| 30 | </p>
|
---|
| 31 | <ul>
|
---|
| 32 | <li>When the <span style="font-style: italic;">src</span> attribute
|
---|
| 33 | is used - or a nested resource collection has been specified
|
---|
| 34 | (<em>since Ant 1.7</em>), the zipfileset is populated with
|
---|
| 35 | zip entries found in the file <span style="font-style:
|
---|
| 36 | italic;">src</span>.<br>
|
---|
| 37 | </li>
|
---|
| 38 | <li>When the <span style="font-style: italic;">dir</span> attribute
|
---|
| 39 | is used, the zipfileset is populated with filesystem files found under <span
|
---|
| 40 | style="font-style: italic;">dir</span>.<br>
|
---|
| 41 | </li>
|
---|
| 42 | </ul>
|
---|
| 43 | <p><code><zipfileset></code> supports all attributes of <code><<a
|
---|
| 44 | href="fileset.html">fileset</a>></code>
|
---|
| 45 | in addition to those listed below.<br>
|
---|
| 46 | </p>
|
---|
| 47 | <p>Since Ant 1.6, a zipfileset can be defined with the <span
|
---|
| 48 | style="font-style: italic;">id </span>attribute and referred to with
|
---|
| 49 | the <span style="font-style: italic;">refid</span> attribute.<br>
|
---|
| 50 | </p>
|
---|
| 51 | <h3>Parameters</h3>
|
---|
| 52 | <table border="1" cellpadding="2" cellspacing="0">
|
---|
| 53 | <tbody>
|
---|
| 54 | <tr>
|
---|
| 55 | <td valign="top"><b>Attribute</b></td>
|
---|
| 56 | <td valign="top"><b>Description</b></td>
|
---|
| 57 | <td valign="top" align="center"><b>Required</b></td>
|
---|
| 58 | </tr>
|
---|
| 59 | <tr>
|
---|
| 60 | <td valign="top">prefix</td>
|
---|
| 61 | <td valign="top">all files in the fileset are prefixed with that
|
---|
| 62 | path in the archive.</td>
|
---|
| 63 | <td align="center" valign="top">No</td>
|
---|
| 64 | </tr>
|
---|
| 65 | <tr>
|
---|
| 66 | <td valign="top">fullpath</td>
|
---|
| 67 | <td valign="top">the file described by the fileset is placed at
|
---|
| 68 | that exact location in the archive.</td>
|
---|
| 69 | <td align="center" valign="top">No</td>
|
---|
| 70 | </tr>
|
---|
| 71 | <tr>
|
---|
| 72 | <td valign="top">src</td>
|
---|
| 73 | <td valign="top">may be used in place of the <i>dir</i> attribute
|
---|
| 74 | to specify a zip file whose contents will be extracted and included
|
---|
| 75 | in the archive.</td>
|
---|
| 76 | <td align="center" valign="top">No</td>
|
---|
| 77 | </tr>
|
---|
| 78 | <tr>
|
---|
| 79 | <td valign="top">filemode</td>
|
---|
| 80 | <td valign="top">A 3 digit octal string, specify the user, group
|
---|
| 81 | and other modes in the standard Unix fashion. Only applies to
|
---|
| 82 | plain files. Default is 644. <em>since Ant 1.5.2</em>.</td>
|
---|
| 83 | <td align="center" valign="top">No</td>
|
---|
| 84 | </tr>
|
---|
| 85 | <tr>
|
---|
| 86 | <td valign="top">dirmode</td>
|
---|
| 87 | <td valign="top">A 3 digit octal string, specify the user, group
|
---|
| 88 | and other modes in the standard Unix fashion. Only applies to
|
---|
| 89 | directories. Default is 755. <em>since Ant 1.5.2</em>.</td>
|
---|
| 90 | <td align="center" valign="top">No</td>
|
---|
| 91 | </tr>
|
---|
| 92 | <tr>
|
---|
| 93 | <td valign="top">encoding</td>
|
---|
| 94 | <td valign="top">The character encoding to use for filenames
|
---|
| 95 | inside the zip file. For a list of possible values see <a
|
---|
| 96 | href="http://java.sun.com/j2se/1.5.0/docs/guide/intl/encoding.doc.html">http://java.sun.com/j2se/1.5.0/docs/guide/intl/encoding.doc.html</a>.
|
---|
| 97 | Defaults to the platform's default character encoding.
|
---|
| 98 | <b>Only supported by zipfileset.</b></td>
|
---|
| 99 | <td align="center" valign="top">No</td>
|
---|
| 100 | </tr>
|
---|
| 101 | </tbody>
|
---|
| 102 | </table>
|
---|
| 103 | <p>The <i>fullpath</i> attribute can only be set for filesets that
|
---|
| 104 | represent a single file. The <i>prefix</i> and <i>fullpath</i>
|
---|
| 105 | attributes cannot both be set on the same fileset.</p>
|
---|
| 106 | <p>When using the <i>src</i> attribute, include and exclude patterns
|
---|
| 107 | may be used to specify a subset of the archive for inclusion in the
|
---|
| 108 | archive as with the <i>dir</i> attribute.</p>
|
---|
| 109 |
|
---|
| 110 | <p>Please note that currently only the <a
|
---|
| 111 | href="../CoreTasks/tar.html">tar</a> and <a
|
---|
| 112 | href="../CoreTaks/zip.html">zip</a> tasks use the permission.</p>
|
---|
| 113 |
|
---|
| 114 | <h3>Parameters specified as nested elements</h3>
|
---|
| 115 |
|
---|
| 116 | <h4>any file system based <a href="resources.html">resource</a> or
|
---|
| 117 | single element resource collection</h4>
|
---|
| 118 |
|
---|
| 119 | <p>The specified resource will be used as src.</p>
|
---|
| 120 |
|
---|
| 121 | <h3>Examples</h3>
|
---|
| 122 | <blockquote>
|
---|
| 123 | <pre> <zip destfile="${dist}/manual.zip"><br> <zipfileset dir="htdocs/manual" prefix="docs/user-guide"/><br> <zipfileset dir="." includes="ChangeLog27.txt" fullpath="docs/ChangeLog.txt"/><br> <zipfileset src="examples.zip" includes="**/*.html" prefix="docs/examples"/><br> </zip><br></pre>
|
---|
| 124 | <p>zips all files in the <code>htdocs/manual</code> directory into
|
---|
| 125 | the <code>docs/user-guide</code> directory in the archive, adds the
|
---|
| 126 | file <code>ChangeLog27.txt</code> in the current directory as <code>docs/ChangeLog.txt</code>,
|
---|
| 127 | and includes all the html files in <code>examples.zip</code> under <code>docs/examples</code>.
|
---|
| 128 | The archive might end up containing the files:</p>
|
---|
| 129 | <code> docs/user-guide/html/index.html<br>
|
---|
| 130 | docs/ChangeLog.txt<br>
|
---|
| 131 | docs/examples/index.html<br>
|
---|
| 132 | </code></blockquote>
|
---|
| 133 |
|
---|
| 134 |
|
---|
| 135 | </body>
|
---|
| 136 | </html>
|
---|