Adding File to Zip Archive
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Sat_Jeej
Posted On:   Monday, January 21, 2002 05:33 PM

Hi,

I am trying to add a file to existing zip archive. Using java.util.zip, I am able to add the file. But the only file in the archive is the file I just added. The method putNextEntry in ZipOutputStream class is losing the existing file in the archive.

Any work around for this?

thanks for your help.

Sat

Re: Adding File to Zip Archive

Posted By:   Dhiren_Bhatia  
Posted On:   Monday, January 21, 2002 06:54 PM

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.

Hope this helps,

Dhiren

About | Sitemap | Contact