ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: cvs commit: jakarta-ant/src/testcases/org/apache/tools/ant/types
Date Fri, 05 Apr 2002 13:05:59 GMT
On 4 Apr 2002, <> wrote:

>   I'm not sure why you can't pass a <dirset> to a <fileset> by
>   reference.

because the result would be counterintuitive.

<dirset id="dirs" dir="." />

is supposed to contain all directories under basedir.

  <fileset refid="dirs" />

will include all files, including the directories will happen by

The problem is, that FileSet doesn't really encapsulate files, but
only a DirectoryScanner - and it is up to the task to decide whether
they want to use the files or directories or even both.

If you pass a dirset as a fileset to a task that is not aware of the
DirSet class (read, all tasks except pathconvert), they will use

An ugly(? - yes, I think it would be ugly) hack to make dirset work
like ones expectation would be to override getDirectoryScanner in
DirSet so that it returns a DirectoryScanner that was a wrapper around
the DirectoryScanner returned by FileSet and reroutes get*Files to
get*Directories and vice versa.  That way, tasks would call
getIncludedFiles and get the directories instead.


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

View raw message