| 1 |
<!DOCTYPE html> |
| 2 |
<!-- |
| 3 |
Licensed to the Apache Software Foundation (ASF) under one or more |
| 4 |
contributor license agreements. See the NOTICE file distributed with |
| 5 |
this work for additional information regarding copyright ownership. |
| 6 |
The ASF licenses this file to You under the Apache License, Version 2.0 |
| 7 |
(the "License"); you may not use this file except in compliance with |
| 8 |
the License. You may obtain a copy of the License at |
| 9 |
|
| 10 |
https://www.apache.org/licenses/LICENSE-2.0 |
| 11 |
|
| 12 |
Unless required by applicable law or agreed to in writing, software |
| 13 |
distributed under the License is distributed on an "AS IS" BASIS, |
| 14 |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 |
See the License for the specific language governing permissions and |
| 16 |
limitations under the License. |
| 17 |
--> |
| 18 |
<html lang="en"> |
| 19 |
|
| 20 |
<head> |
| 21 |
<link rel="stylesheet" type="text/css" href="../stylesheets/style.css"> |
| 22 |
<title>RenameExtensions Task</title> |
| 23 |
</head> |
| 24 |
|
| 25 |
<body> |
| 26 |
|
| 27 |
<h2 id="renameexts">RenameExtensions</h2> |
| 28 |
<h3><em><u>Deprecated</u></em></h3> |
| 29 |
<p><em>This task has been <u>deprecated</u>. Use the <a href="../Tasks/move.html">move</a> task |
| 30 |
with a <a href="../Types/mapper.html#glob-mapper">glob mapper</a> instead.</em></p> |
| 31 |
<h3>Description</h3> |
| 32 |
<p>Renames files in the <var>srcDir</var> directory ending with the <var>fromExtension</var> string |
| 33 |
so that they end with the <var>toExtension</var> string. Files are only replaced |
| 34 |
if <var>replace</var> is <q>true</q>.</p> |
| 35 |
<p>See the section on <a href="../dirtasks.html#directorybasedtasks">directory based tasks</a>, on |
| 36 |
how the inclusion/exclusion of files works, and how to write patterns. This task forms an |
| 37 |
implicit <a href="../Types/fileset.html">FileSet</a> and supports most attributes |
| 38 |
of <code><fileset></code> (<var>dir</var> becomes <var>srcDir</var>) as well as the |
| 39 |
nested <code><include></code>, <code><exclude></code> |
| 40 |
and <code><patternset></code> elements.</p> |
| 41 |
<h3>Parameters</h3> |
| 42 |
<table class="attr"> |
| 43 |
<tr> |
| 44 |
<th scope="col">Attribute</th> |
| 45 |
<th scope="col">Description</th> |
| 46 |
<th scope="col">Required</th> |
| 47 |
</tr> |
| 48 |
<tr> |
| 49 |
<td>defaultexcludes</td> |
| 50 |
<td>indicates whether default excludes should be used or not (<q>yes|no</q>).</td> |
| 51 |
<td>No; defaults to <q>yes</q></td> |
| 52 |
</tr> |
| 53 |
<tr> |
| 54 |
<td>excludes</td> |
| 55 |
<td>comma- or space-separated list of patterns of files that must be excluded.</td> |
| 56 |
<td>No; defaults to default excludes or none if <var>defaultexcludes</var> is <q>no</q></td> |
| 57 |
</tr> |
| 58 |
<tr> |
| 59 |
<td>excludesfile</td> |
| 60 |
<td>name of a file. Each line of this file is taken to be an exclude pattern</td> |
| 61 |
<td>No</td> |
| 62 |
</tr> |
| 63 |
<tr> |
| 64 |
<td>fromExtension</td> |
| 65 |
<td>The string that files must end in to be renamed</td> |
| 66 |
<td>Yes</td> |
| 67 |
</tr> |
| 68 |
<tr> |
| 69 |
<td>includes</td> |
| 70 |
<td>comma- or space-separated list of patterns of files that must be included.</td> |
| 71 |
<td>No; defaults to all (<q>**</q>)</td> |
| 72 |
</tr> |
| 73 |
<tr> |
| 74 |
<td>includesfile</td> |
| 75 |
<td>name of a file. Each line of this file is taken to be an include pattern</td> |
| 76 |
<td>No</td> |
| 77 |
</tr> |
| 78 |
<tr> |
| 79 |
<td>replace</td> |
| 80 |
<td>Whether the file being renamed to should be replaced if it already exists</td> |
| 81 |
<td>No</td> |
| 82 |
</tr> |
| 83 |
<tr> |
| 84 |
<td>srcDir</td> |
| 85 |
<td>The starting directory for files to search in</td> |
| 86 |
<td>Yes</td> |
| 87 |
</tr> |
| 88 |
<tr> |
| 89 |
<td>toExtension</td> |
| 90 |
<td>The string that renamed files will end with on completion</td> |
| 91 |
<td>Yes</td> |
| 92 |
</tr> |
| 93 |
</table> |
| 94 |
<h3>Examples</h3> |
| 95 |
|
| 96 |
<pre> |
| 97 |
<renameext srcDir="/source/project1" |
| 98 |
includes="**" |
| 99 |
excludes="**/samples/*" |
| 100 |
fromExtension=".java.keep" |
| 101 |
toExtension=".java" |
| 102 |
replace="true"/></pre> |
| 103 |
|
| 104 |
</body> |
| 105 |
</html> |