How to rename n files with ANT? (Batch Job)

Thomas Zuberbuehler picture Thomas Zuberbuehler · Nov 19, 2010 · Viewed 14.3k times · Source

How can I rename 1..n file with ANT? I would like to rename any files with xxxx.default.properties to xxxx.local.properties.

Thank you.

Answer

OscarRyz picture OscarRyz · Nov 19, 2010

Using the move task you could do something like this:

  <move todir="my/src/dir" includeemptydirs="false">
    <fileset dir="my/src/dir"/>
    <mapper type="glob" from="*.default.properties" to="*.local.properties"/>
  </move>

Give it a try and let us know.