Thanks a lot for showing me how it can be accomplished. I was able to finish my work :-)
Cheers, Vijay V
Gilles Dodinet wrote:
Vijay V wrote:
Hi,
I have to figure out from a given directory if a particular type of file exists
Say there is a directory by name com/times and say there are files by name
Bundle.java
Bundle_en.java
Bundle_en_us.java
I will have to figure out if a file by name say Bundle_en.java exists. So basically is there a way to get all the files present in a given directory and then to iterate over it.
Is there a tag which i can use?
Vijay,
you can use <ant:filescanner/> for that , something like the following :
<ant:fileScanner var="bundles">
<fileset dir="${basedir}/src/main/resources" includes="**/Bundle*.java" />
</fileset>
</ant:fileScanner>
<j:forEach items="${bundles.iterator()}" var="bundleName">
<!-- dostuff with bundleName -->
</j:forEach>
-- gd
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
