Java Mailing List Archive

Apache Ant Archive

» Ant Users List
» Ant Developers List
replace an entry in a zip file?

replace an entry in a zip file?

2007-06-14       - By Cyril Sagan
Reply:     1     2     3     4     5     6  

GOAL:  To replace one entry in a zip file with an updated file.

I cannot find an elegant way to do this, short of <unzip>'ing the
archive, replacing the file of interest and then re-<zip>.  It seems
there should be a better way.  Can anyone help?



FWIW, It looks like the Ant 1.6.5 source code *tried* to support this.
Note that the comment describes a the setting "overwrite" for the
duplicate attribute of <zip> task which would provide exactly what I
want, the bad news is that it doesn't seem to be implemented.  :-(

I've included the comment, and the duplicate logic below.

©2008 - Jax Systems, LLC, U.S.A.