1

I have the need to add a file to an already-existing self-extracting ZIP file. The best library I could find online is TrueZip, which was created by Christian Schlichtherle. The TrueZip 7.3+ version claims to have the ability to append new files into an already-existing archive, but the following online documentation does a poor job of demonstrating this:

http://illegalexception.schlichtherle.de/2011/07/26/appending-to-zip-files/

Can anyone provide some sample code which uses TrueZip to add a file to an already-existing ZIP archive?

(End note: I am actually working with a self-extracting ZIP file, but I read online that TrueZip can handle this.)

@ChristianSchlichtherle I will give you a bounty if you update your website with working usable examples of TrueZip.

5
  • If you use Java 7+ have you tried and opened the zip, even read only, with the zip filesystem provider?
    – fge
    Commented May 18, 2015 at 8:58
  • 1
    Wikipedia: "A .ZIP file is correctly identified by the presence of an end of central directory record which is located at the end of the archive structure in order to allow the easy appending of new files." So do-it-yourself should well be within reach. Splitting exe part of zip part (if needed).
    – Joop Eggen
    Commented May 18, 2015 at 8:59
  • I found the Java 7 library to be extremely cryptic and difficult to use. Yes, this would be the way to go if possible, but I could not find very good material online for this route either. Commented May 18, 2015 at 9:00
  • @JoopEggen We are already going in this direction, but keeping our fingers crossed that the TrueZip guy will throw us a bone ^ ^. Commented May 18, 2015 at 9:00
  • Java has also a zip file system where appending is a simple call to Files.copy
    – Joop Eggen
    Commented May 18, 2015 at 9:04

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.