ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: The zip update problem
Date Fri, 10 Jan 2003 12:24:21 GMT
Mails crossed, sorry.

On Fri, 10 Jan 2003, Antoine Levy-Lambert <>

>> > Classes interested in knowing the modification date/time of a
>> > file should ask the scanner, not the file directly any more.
>> Why?  They might be better of accessing the Resources directly.
> The reason is that a file in a fileset can be present on the
> filesystem directly, or might be a zip entry.

I've been too terse here.  I was assuming the scanner would return the
Resources in the first place instead of names -
i.e. getIncludedResources and with them, the tasks don't need to go
back to the DirectoryScanner to find the lastmodified time.

> In our new concept, the Scanner is the class which knows where are
> files or zip entries and how to read their properties.

I've taken a different twist by returning the Resources directly.

> <zip ...>
>   <zipfileset src="" id="foo"/>
> </zip>
> <copy todir="mydir">
>   <fileset refid="foo"/>
> </copy>
> this should copy all the zip entries from to the filesystem,
> to the subdirectory mydir

Maybe in the long run, yes ...

For this to work, Resource (I'm sticking to the name for now) would
have to provide readers to its content.  We are getting close to a
full-fledged VFS layer here and would probably be better of to join
forces with the vfs code in the jakarta-commons-sandbox IMHO.

>> > one would add two new functions in DirectoryScanner
>> > long getModificationTime(String path)
> this function would be to get the modification time of a file or of
> a zip entry,

redundant if we return the Resources.

>> > and
>> > Resource [ ]  list(String path)
>> Under which circumstances would you expect more than one resource
>> for a given path?
> this function would be used in the scandir method of,
> instead of instead of String []
> newfiles=dir.list();

Would we need to expose this method outside DirectoryScanner?

> Maybe the name Resource for the class is confusing;

I'm not good at names.  Throughout Ant you will find more than enough
things that back this claim. ;-)


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

View raw message