File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
Author

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?
Thanks.
Jim Yingst
Wanderer
Sheriff

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: http://aspose.com/file-tools
 
subject: Append to Existing Zip File
 
Similar Threads
Not able to put some files inside Zip file
Java Error While appending to Zip File
generate large excel using zip stream
How to append a file to an existing zip file
Serialization problem !!!