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>RenameExtensions Task</title>
|
---|
23 | </head>
|
---|
24 |
|
---|
25 | <body>
|
---|
26 |
|
---|
27 | <h2><a name="renameexts">RenameExtensions</a></h2>
|
---|
28 | <h3><i>Deprecated</i></h3>
|
---|
29 | <p><i>This task has been deprecated. Use the <a href="../CoreTasks/move.html">move</a>
|
---|
30 | task with a <a href="../CoreTypes/mapper.html#glob-mapper">glob mapper</a> instead.</i></p>
|
---|
31 | <h3>Description</h3>
|
---|
32 | <p>Renames files in the <code>srcDir</code> directory ending with the
|
---|
33 | <code>fromExtension</code> string so that they end with the
|
---|
34 | <code>toExtension</code> string. Files are only replaced if
|
---|
35 | <code>replace</code> is true
|
---|
36 | </p>
|
---|
37 | <p>See the section on
|
---|
38 | <a href="../dirtasks.html#directorybasedtasks">directory based tasks</a>, on how the
|
---|
39 | inclusion/exclusion of files works, and how to write patterns.
|
---|
40 | This task forms an implicit <a href="../CoreTypes/fileset.html">FileSet</a> and
|
---|
41 | supports all attributes of <code><fileset></code>
|
---|
42 | (<code>dir</code> becomes <code>srcDir</code>) as well as the nested
|
---|
43 | <code><include></code>, <code><exclude></code> and
|
---|
44 | <code><patternset></code> elements.</p>
|
---|
45 | <h3>Parameters</h3>
|
---|
46 | <table border="1" cellpadding="2" cellspacing="0">
|
---|
47 | <tr>
|
---|
48 | <td valign="top"><b>Attribute</b></td>
|
---|
49 | <td valign="top"><b>Description</b></td>
|
---|
50 | <td align="center" valign="top"><b>Required</b></td>
|
---|
51 | </tr>
|
---|
52 | <tr>
|
---|
53 | <td valign="top">defaultexcludes</td>
|
---|
54 | <td valign="top">indicates whether default excludes should be used or not
|
---|
55 | ("yes"/"no"). Default excludes are used when
|
---|
56 | omitted.</td>
|
---|
57 | <td valign="top" align="center">No</td>
|
---|
58 | </tr>
|
---|
59 | <tr>
|
---|
60 | <td valign="top">excludes</td>
|
---|
61 | <td valign="top">comma- or space-separated list of patterns of files that must be
|
---|
62 | excluded. No files (except default excludes) are excluded when
|
---|
63 | omitted.</td>
|
---|
64 | <td valign="top" align="center">No</td>
|
---|
65 | </tr>
|
---|
66 | <tr>
|
---|
67 | <td valign="top">excludesfile</td>
|
---|
68 | <td valign="top">the name of a file. Each line of this file is
|
---|
69 | taken to be an exclude pattern</td>
|
---|
70 | <td valign="top" align="center">No</td>
|
---|
71 | </tr>
|
---|
72 | <tr>
|
---|
73 | <td valign="top">fromExtention</td>
|
---|
74 | <td valign="top">The string that files must end in to be renamed</td>
|
---|
75 | <td valign="top" align="center">Yes</td>
|
---|
76 | </tr>
|
---|
77 | <tr>
|
---|
78 | <td valign="top">includes</td>
|
---|
79 | <td valign="top">comma- or space-separated list of patterns of files that must be
|
---|
80 | included. All files are included when omitted.</td>
|
---|
81 | <td valign="top" align="center">No</td>
|
---|
82 | </tr>
|
---|
83 | <tr>
|
---|
84 | <td valign="top">includesfile</td>
|
---|
85 | <td valign="top">the name of a file. Each line of this file is
|
---|
86 | taken to be an include pattern</td>
|
---|
87 | <td valign="top" align="center">No</td>
|
---|
88 | </tr>
|
---|
89 | <tr>
|
---|
90 | <td valign="top">replace</td>
|
---|
91 | <td valign="top">Whether the file being renamed to should be
|
---|
92 | replaced if it already exists</td>
|
---|
93 | <td valign="top" align="center">No</td>
|
---|
94 | </tr>
|
---|
95 | <tr>
|
---|
96 | <td valign="top">srcDir</td>
|
---|
97 | <td valign="top">The starting directory for files to search in</td>
|
---|
98 | <td valign="top" align="center">Yes</td>
|
---|
99 | </tr>
|
---|
100 | <tr>
|
---|
101 | <td valign="top">toExtension</td>
|
---|
102 | <td valign="top">The string that renamed files will end with on
|
---|
103 | completion</td>
|
---|
104 | <td valign="top" align="center">Yes</td>
|
---|
105 | </tr>
|
---|
106 | </table>
|
---|
107 | <h3>Examples</h3>
|
---|
108 | <blockquote>
|
---|
109 | <p><code><renameext srcDir="/source/project1"
|
---|
110 | includes="**"
|
---|
111 | excludes="**/samples/*"
|
---|
112 | fromExtension=".java.keep"
|
---|
113 | toExtension=".java"
|
---|
114 | replace="true"/>
|
---|
115 | </code>
|
---|
116 | </p>
|
---|
117 | </blockquote>
|
---|
118 |
|
---|
119 |
|
---|
120 |
|
---|
121 | </body>
|
---|
122 | </html>
|
---|
123 |
|
---|