wood burning stoves 2.0
The moose likes Ant, Maven and Other Build Tools and the fly likes How to iterate fileset? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "How to iterate fileset?" Watch "How to iterate fileset?" New topic
Author

How to iterate fileset?

Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3640
We have following Ant code where we are getting <fileset>

<fileset id="id1" dir="D:/SN/two" includes="**/*.java">
<depend targetdir="D:/SN/one"/>
</fileset>

I want to iterate this <fileset>. How to achieve this?


My blood is tested +ve for Java.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17039
    
  26

You'll have to provide more information. FileSets are properties of Ant tasks, so it depends on the Ant task you're attempting to execute.


An IDE is no substitute for an Intelligent Developer.
Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3640
We are using Depend Selector. Basically it compares files at given two locations and give list of recently modified files as a FileSet.

http://ant.apache.org/manual/CoreTypes/selectors.html#dependselect
Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3640
Knock Knock!
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 32501
    
214

You could use the ant-contrib for loop task.


[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to iterate fileset?
 
It's not a secret anymore!