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.7 KiB

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