Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Append to Existing Zip File

 
James Swan
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see another way, using the standard Java libraries.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic