wood burning stoves*
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

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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 java.util.zip.* 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
wood burning stoves
subject: Append to Existing Zip File
Similar Threads
generate large excel using zip stream
How to append a file to an existing zip file
Not able to put some files inside Zip file
Serialization problem !!!
Java Error While appending to Zip File