ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: zip from zip with mappers
Date Wed, 21 Nov 2012 05:00:10 GMT
On 2012-11-20, Patrick Martin wrote:

> Is there any way this can be available, in the compress antlib maybe?

The main problem is the way zipfileset and zipentry work not the zip
task - and the compress Antlib doesn't address this, either.

> Is the addition of <mapper> support directly in <zip> not possible either
> (so we could make use of the zipfileset nested directly, but mapping zip
> entry names at the last step)?

At the surface this doesn't look too hard but it becomes very difficult
once you realize that most methods you have to touch are protected and
there are subclasses overriding them - so you can't change their
signatures.  This (the difficulty of modifying the zip task) is one of
the reasons the compress Antlib was started.

It would be possible to aff mapper support to the compressing tasks in
the compress Antlib but then again the Zip task over there doesn't
contain any special handling for zipfilesets and would be as slow as
using mappedresources.

If you wanted to tackle the problem by patching Ant, working on
ZipFileSet and/or ArchiveFileSet as well as the ArchiveEntry subclasses
is the way to go.  The rationale for the current behavior is that the
code is very conservative: when ZipFileSet hands out the ZipResources it
cannot know when the opened archive is no longer needed so in order to
avoid leaks each method that needs something from the archive is
responsible for opening and closing it.  Any solution that kept the
archive open must ensure the archive is eventually closed - and we can't
rely on the garbage collector here.


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

View raw message