ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject Re: DirectoryScanner exclude subdirectories ?
Date Thu, 06 Oct 2005 20:27:59 GMT
There is no need to exclude anything that wouldn't be
included based on includes.  So if you instantiate a
DirectoryScanner and set its includes to {"*"} it will
find every file and directory that lives immediately
below the specified basedir.  If you intend to use
DirectoryScanner from code, there is really no need to
use the selector, as you retrieve files and
directories with separate API calls against
DirectoryScanner; if you don't want directories, just
don't retrieve them.

-Matt

--- Gilbert Rebhan <ant@schillbaer.de> wrote:

> Hi,
> 
> Matt Benson wrote:
> > I can't remember the entire context of this
> > discussion... but includes/excludes are used by
> > DirectoryScanner.  To include only child "files"
> of
> > basedir, the correct include pattern is "*". 
> However,
> > this includes directories which are basedir's
> > immediate children.  To further restrict the
> selection
> > to non-directory files, use the <type> selector as
> > well.
> > 
> > -Matt
> 
> my first post was =
> 
> /*
> ...
> 
> i want to use the DirectoryScanner in an own task.
> 
> i want to exclude subdirectories and only including
> the files in the root of basedir.
> 
> DirectoryScanner ds =
> fs.getDirectoryScanner(getProject());
>         String[] includes = {"*.*"};
>         String[] excludes = {"**\\**"};
>         ds.setIncludes(includes);
>         ds.setExcludes(excludes);
> String[] names = ds.getIncludedFiles();
> 
> 
> What are the correct include / exclude patterns to
> include ownly the files in root of basedir but
> exclude
> all subdirectories and files in subdirectories ?
> 
> ...
> */
> 
> i want to use it in a selfwritten task not in an
> ant(xml)script
> 
> 
> Question =
> 
> is it possible to use DirecoryScanner standalone or
> only combined
> with a type selector ?
> 
> i believe it's easier to roll my own solution
> instead of using
> DirectoryScanner combined with a selector.
> 
> Regards, Gilbert
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 
> 



	
		
______________________________________________________ 
Yahoo! for Good 
Donate to the Hurricane Katrina relief effort. 
http://store.yahoo.com/redcross-donate3/ 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message