ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Murray, Mike" <>
Subject RE: FileSet Scanning & Popluation
Date Fri, 31 Oct 2003 14:14:04 GMT
Thanks.  That is useful information, but it won't help me in this case since the multiple use
includes one time by my custom task, and the other times are by built-in tasks, such as copy,
zip, etc.

I think what I need a "scan once" option on FileSet.

Thanks, Mike

-----Original Message-----
From: Stefan Bodewig []
Sent: Friday, October 31, 2003 1:15 AM
Subject: Re: FileSet Scanning & Popluation

On Thu, 30 Oct 2003, Mike Murray <> wrote:

> Although a FileSet can be defined with an id for reuse, it appears
> that every time is is used it performs its scan.


> Is there any way to have it scan and populate once, and then access
> it from multiple tasks?

Reuse the DirectoryScanner instance.

> I'm focusing on its getDirectoryScanner() method.

Because of this I assume that you are talking about tasks of your
own.  In the first task, do something like

getProject().addReference("my-ds-key", fs.getDirectoryScanner());

and when you want to reuse it in the other task

DirectoryScanner ds = (DirectoryScanner) getProject().getReference("my-ds-key");

So you don't ID the fileset but the DirectoryScanner itself.

Sorry, no built-in way to do that (yet?).


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

View raw message