> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, 27 March 2002 12:38 PM
> To: Ant Users List
> Subject: Renaming the directories recursively
>
>
>
> I want to rename the directories only recursively. Basically, I want to
> rename _com/_alltel/_ebusiness/........ to
> com/alltel/ebusiness............... I checked out the documentation, and
> figured out how to rename the files.
>
> This is the code I am trying to useand it renames only the top most
> directory leaving the subdirectories without renaming.
> <target name="move" >
>      <move todir="." >
>      <fileset dir="." includes="**" >
>      </fileset>
>      <mapper type="glob" from="_*" to="*"/>
>      </move>
>      </target>
>
>      Can somebody help me out ?

The names that get passed to the mapper are paths relative to the root
directory of the source file set.  So, in your case, the mapper will be
getting passed names like

_com/_alltel/_ebusiness/somefile.java
_com/_alltel/_ebusiness/someotherfile.java

This is why you're seeing only the top most directory being renamed - the
glob mapper is removing the first '_' only from all of the names.

Unfortunately, to solve your particular problem, I think you will have to
write your own mapper implementation.  It's not particularaly hard -
implement FileNameMapper to do the appropriate conversion, compile it up,
and use <mapper classname=".." /> to use it.

Of course, that is a rather odd directory layout you've got - why can't you
get rid of the underscores from the directory names and give the whole
renaming problem a miss?


Adam


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to