Java Mailing List Archive

http://www.ant-tasks.com/

Apache Ant Archive

» Ant Users List
» Ant Developers List
Copying a subdirectory hierarchy containing variable intermediate subdirectory n

Copying a subdirectory hierarchy containing variable intermediate subdirectory n

2007-08-08       - By Laszlo Szabo

I'm trying to copy a subdirectory and its contents when it is separated from
the root directory by a couple of directories that are machine generated and
therefore have variable names.

For example in the following directory structure:
C:\BUILDS\Proj1_Code\devbuild\385633b5\f0e5959c\ejbModule

The 'root' directory for the build is C:\BUILDS\Proj1_Code\devbuild
The generated directories are 385633b5 and f0e5959c
The directory that I want to copy is ejbModule.

Is there an easy way to do this? The following copies everything below the
root which is not what I want (I only want ejbModule and its contents).

<copy todir="${build.dir}/test" >
                       <fileset dir="C:/BUILDS/Proj1_Code/devbuild">
                          <include name="**/ejbModule/**"/>
                       </fileset>

©2008 ant-tasks.com - Jax Systems, LLC, U.S.A.