ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject Re: FileSet#iterator only returning files
Date Wed, 19 Oct 2005 19:53:10 GMT
--- Stefan Bodewig <bodewig@apache.org> wrote:

> Hi (Matt ;-),
> 
> the design decision to not return directories in
> FileSet affects the
> tasks that want to read files and directories.
> 
> If I code a generic task that just uses iterator,
> I'll never see
> directories from FileSet (or any of FileSet's
> subclasses), instead I
> have to check whether I'm dealing with a fileset
> subclass.

That is what I had been doing, yes:

  public void add(FileSet fs) {
    add((ResourceCollection)
        new /*oata.types.resources.*/BCFileSet(fs));
  }
  public void add(ResourceCollection rc) {
     //whatever
  }

> 
> Even worse, there is no way to get the included
> directories of
> 
> <union>
>   <fileset dir="A"/>
>   <fileset dir="B"/>
> </union>

Hmm... good point.  :(
> 
> What shall we do?  Return files and directories and
> let the user
> explicitly use a <type> selector would be my
> preference.
> 
I don't see that we have much choice given your
example above.  Wouldn't we have to invert the
situation and explicitly ignore directories in tasks
that have historically used only the results of
ds.getIncludedFiles() ?

-Matt

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



	
		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

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


Mime
View raw message