deleting files not in whitelist

Jason Guild <[email protected]>
Newsgroups gmane.comp.jakarta.ant.user
Message-ID <[email protected]>
Hello:

I have a build file which declares a <resources> containing a list of 
expected files which are relative to some directory. I am trying to 
delete any files from that directory which /are not present/ in the 
<resourcelist>, and I can't figure out how to do that with the <delete> 
task and my understanding of the standard selectors.

Here's my resource list:

    <resources id="my-whitelist">
         <resourcelist basedir="${some.dir}">
             <url url="${target.files.url}"/>
         </resourcelist>
    </resources>

Basically my-whitelist is simply a list of filenames which are expected 
to exist relative to ${some.dir}.

In a target, I would like to somehow use the <delete> task to delete any 
files found in ${some.dir} which are /not listed in/ "my-whitelist", 
like this:

    <delete dir="${some.dir}">
         <not>
             <resources refid="my-whitelist"/>
    </not>
    </delete>

But this doesn't work. I also tried:

    <delete>
         <restrict>
             <fileset dir="${some.dir}"/>
             <rsel:not
    xmlns:rsel="antlib:org.apache.tools.ant.types.resources.selectors">
                 <resources refid="my-whitelist"/>
             </rsel:not>
         </restrict>
    </delete>

Which doesn't work either.
Any help you can provide would be appreciated.

Thanks,
Jason


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.