File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes I/O and Streams and the fly likes Append to Existing Zip File Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Append to Existing Zip File" Watch "Append to Existing Zip File" New topic

Append to Existing Zip File

James Swan
Ranch Hand

Joined: Jun 26, 2001
Posts: 403
Ok so it doesn't look like the* classes allow for appending new entries into an existing zip archive through their APIs.
To get around this I do the following:
1) create a new Zip file
2) read the contents of the old Zip file and write them out to the new Zip, appending the new entries on the end of the new zip file
3) replace the old Zip file with the new one

Has anyone come up with a better way of achieving this?
Jim Yingst

Joined: Jan 30, 2000
Posts: 18671
I don't see another way, using the standard Java libraries.

"I'm not back." - Bill Harding, Twister
I agree. Here's the link:
subject: Append to Existing Zip File
It's not a secret anymore!