You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

renameextensions.html 3.6 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Language" content="en-us">
  4. <title>RenameExtensions Task</title>
  5. </head>
  6. <body>
  7. <h2><a name="renameexts">RenameExtensions</a></h2>
  8. <h3><i>Deprecated</i></h3>
  9. <p><i>This task has been deprecated. Use the <a href="../CoreTasks/move.html">move</a>
  10. task with a <a href="../CoreTypes/mapper.html#glob-mapper">glob mapper</a> instead.</i></p>
  11. <h3>Description</h3>
  12. <p>Renames files in the <code>srcDir</code> directory ending with the
  13. <code>fromExtension</code> string so that they end with the
  14. <code>toExtension</code> string. Files are only replaced if
  15. <code>replace</code> is true
  16. </p>
  17. <p>See the section on
  18. <a href="../dirtasks.html#directorybasedtasks">directory based tasks</a>, on how the
  19. inclusion/exclusion of files works, and how to write patterns.
  20. This task forms an implicit <a href="../CoreTypes/fileset.html">FileSet</a> and
  21. supports all attributes of <code>&lt;fileset&gt;</code>
  22. (<code>dir</code> becomes <code>srcDir</code>) as well as the nested
  23. <code>&lt;include&gt;</code>, <code>&lt;exclude&gt;</code> and
  24. <code>&lt;patternset&gt;</code> elements.</p>
  25. <h3>Parameters</h3>
  26. <table border="1" cellpadding="2" cellspacing="0">
  27. <tr>
  28. <td valign="top"><b>Attribute</b></td>
  29. <td valign="top"><b>Description</b></td>
  30. <td align="center" valign="top"><b>Required</b></td>
  31. </tr>
  32. <tr>
  33. <td valign="top">defaultexcludes</td>
  34. <td valign="top">indicates whether default excludes should be used or not
  35. (&quot;yes&quot;/&quot;no&quot;). Default excludes are used when
  36. omitted.</td>
  37. <td valign="top" align="center">No</td>
  38. </tr>
  39. <tr>
  40. <td valign="top">excludes</td>
  41. <td valign="top">comma- or space-separated list of patterns of files that must be
  42. excluded. No files (except default excludes) are excluded when
  43. omitted.</td>
  44. <td valign="top" align="center">No</td>
  45. </tr>
  46. <tr>
  47. <td valign="top">excludesfile</td>
  48. <td valign="top">the name of a file. Each line of this file is
  49. taken to be an exclude pattern</td>
  50. <td valign="top" align="center">No</td>
  51. </tr>
  52. <tr>
  53. <td valign="top">fromExtention</td>
  54. <td valign="top">The string that files must end in to be renamed</td>
  55. <td valign="top" align="center">Yes</td>
  56. </tr>
  57. <tr>
  58. <td valign="top">includes</td>
  59. <td valign="top">comma- or space-separated list of patterns of files that must be
  60. included. All files are included when omitted.</td>
  61. <td valign="top" align="center">No</td>
  62. </tr>
  63. <tr>
  64. <td valign="top">includesfile</td>
  65. <td valign="top">the name of a file. Each line of this file is
  66. taken to be an include pattern</td>
  67. <td valign="top" align="center">No</td>
  68. </tr>
  69. <tr>
  70. <td valign="top">replace</td>
  71. <td valign="top">Whether the file being renamed to should be
  72. replaced if it already exists</td>
  73. <td valign="top" align="center">No</td>
  74. </tr>
  75. <tr>
  76. <td valign="top">srcDir</td>
  77. <td valign="top">The starting directory for files to search in</td>
  78. <td valign="top" align="center">Yes</td>
  79. </tr>
  80. <tr>
  81. <td valign="top">toExtension</td>
  82. <td valign="top">The string that renamed files will end with on
  83. completion</td>
  84. <td valign="top" align="center">Yes</td>
  85. </tr>
  86. </table>
  87. <h3>Examples</h3>
  88. <blockquote>
  89. <p><code>&lt;renameext srcDir=&quot;/source/project1&quot;
  90. includes=&quot;**&quot;
  91. excludes=&quot;**/samples/*&quot;
  92. fromExtension=&quot;.java.keep&quot;
  93. toExtension=&quot;.java&quot;
  94. replace=&quot;true&quot;/&gt;
  95. </code>
  96. </p>
  97. </blockquote>
  98. <hr>
  99. <p align="center">Copyright &copy; 2000-2002 Apache Software Foundation. All rights
  100. Reserved.</p>
  101. </body>
  102. </html>