ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Kennard <>
Subject Re: Multiple files to <java> task
Date Sat, 20 Jan 2007 07:59:55 GMT
OK - convoluted nastiness but it works to make a quoted space 
delimited list of file names.

The two "commands" below are needed to translate all the '/' to 
${file.separator} s in the
original property which are coded with '/' separators. and expand it to
the full path so it will compare character for character with the
path built by the final fileset.

<path id="xmlcode.dir">
      <pathelement location="${src.home}/XMLSource"/>


Now I can create the fileset for the source directory

<fileset dir="${xmlcodedir}" id="xmlcode.files">
      <include name="*.xml"/>

this will "map out" the path to ""
and will put '" "' between every two entries

<pathconvert targetos="unix"
              pathsep="&quot; &quot;"
     <map from="${xmlcodedir}" to=""/>

Now you just have to add the leading and trailing '"' and you have
a nice quoted space delimited list of files. (hopefully suitable for 
a command line="" argument in a <java/> task :)

<echo message="&quot;${xmlfiles}&quot;${line.separator}" />


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message