I have a series of files that need to be converted to a common format. ie. P1075.ABC => P1075.abc p1075.Abc => P1075.abc I would like to do this when the file gets moved or copied from my source directory to my deploy directory. I can get the file extension to be converted using a globmapper inside the move command, but can't seems to figure out what I need to do to make everything preceeding the '.' to be the way I want. This is what I have now, and was told that a regexp wouldn't be able to work with this. Any help is appreciated.
More>>

I have a series of files that need to be converted to a common format.

ie. P1075.ABC => P1075.abc

p1075.Abc => P1075.abc

I would like to do this when the file gets moved or copied from my source directory to my deploy directory. I can get the file extension to be converted using a globmapper inside the move command, but can't seems to figure out what I need to do to make everything preceeding the '.' to be the way I want.

This is what I have now, and was told that a regexp wouldn't be able to work with this.

my cursory look through the docs show your need might be just slighly to fancy for the core task behaviors for . have you considered a custom (user-defined) task via your own java class to accomplish this? You could construct it in such way that an ordinary, nested could pass you the list of files to operate on.

extend org.apache.tools.ant.Task

implement: public void addFileSet(org.apache.tools.ant.types.FileSet fs_obj) { /* add the fs_obj to a Vector (to support multiple FileSets for example), or whatever to store the reference */ }

Note that for a given FileSet object, you get the list of files from the toString() method, noting all returned files are concatenated together with a semi-colon. suggest a StringTokenizer or something

compile to a class and jar it up

use a ant task to reference your class name against some new ant task name and ensure your jar file is in the classpath at some point