Java Mailing List Archive

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

Apache Ant Archive

» Ant Users List
» Ant Developers List
custom selector which examines multiple files before returning an answer

custom selector which examines multiple files before returning an answer

2005-06-07       - By Frode E. Moe
Reply:     1     2     3     4  

Hi, I'm trying to implement a way to detect duplicate .jar files (where
only the version differ) and delete all duplicates except the newest.
The way I hoped to implement this was to use the <delete> task together
with a custom Selector, like this:
 <delete>
   <fileset dir="lib" includes="**/*.jar">
     <custom classname="com.coretrek.DuplicateSElector" />
   </fileset>
 </delete>

Unfortunately this doesn't seem to work out very well, because the
FileSelector interface's "isSelected()" requires my class to provide an
answer for each file on the fly, while I need to read and sort
the entire "candidate" fileset before selecting out the dupes.

Is there another way to implement a FileSet filtering mechanism that
would work for this purpose, or do I have to write a custom
"DeleteDuplicates" task?


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)


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