ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <>
Subject Re: [VOTE] Porting <fileset> 'file' attribute to 1.5 branch
Date Mon, 02 Sep 2002 16:49:50 GMT
Wannheden, Knut wrote:
> Hi,
> If you add the file attribute to the AbstractFileSet class I suppose that it
> will be available for both the <fileset> and <dirset> tasks, right?  In that
> case the attribute name is maybe somewhat unfortunate.  E.g.
> 	<dirset file="somedir"/>

I'm out of the loop on dirset - I've not had a need for it and thus have 
not used it.  But it would also inherit the 'file' attribute and 
probably do the expected thing if somedir was really a directory.

Can anyone confirm if this works as it should?

As for naming - it doesn't matter to me.  includes cannot be used. 
select maybe.  I'm fine with leaving it as 'file' though.  Even can represent a directory, so its not a terribly confusing 
name for us Java developers :)

> another question:  Why not extend the concept to several files instead of a
> single file?  E.g.
> 	<fileset file="foo.txt,bar.txt"/>

A FileSet must be rooted at a base directory - this is what makes it 
sometimes painful to work with.  So only a single file can be turned 
into a FileSet, unless perhaps there is logic to climb their directory 
trees and find a common root and base them from there.

I would think a better long-term refactoring is to turn a FileSet into, 
literally, a set of files that do not need to be rooted by the same 
parent directory.  This would likely be a pretty substantial refactoring.

> Further (as I'm not familiar with the details of the IntrospectionHelper) I
> was wondering what happens if the value identifies a non-existant file.  I
> suppose I will get a message like "No directory specified for <fileset>.",
> right?  Maybe the setFile(File) method should check the file, or at least
> its parent directory for existence.

The file does not have to exist for the setter to work.  A 
does not have to point to an existing file.  Maybe the FileUtils 
requires it exist, I'm not sure.  But theoretically it should not matter 
if the file exists or not when the fileset is defined, only when it is used.


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

View raw message