ZIP file problem

I am using the java.util.zip package to create zip files. I can
create a new archive and add files to it without any trouble. But if
I already have a zip file created, how do I add a new file to the
archive without impacting the existing files? I looked through the
APIs with no luck. I would rather avoid extracting all the files and
rebuilding the archive from scratch if at all possible.

Thanks

Can’t be done. From a quick look through the javadoc, Apache Compress can’t do it either. I think you’re out of luck.

Hi Renoria,

A simple google search gave me this link:
http://snippets.dzone.com/posts/show/3468

I also found a post by someone saying

[quote]You will have to save the existing zip file in a temporary file, add the contents of the existing zip file to the temporary file and then add the new contents you want to update the zip file with.

The java.util.zip api’s do not provide random access to zip files.
[/quote]
// Json

Oh Okay, Thanks for the help.