entry « Zip « Java I/O Q&A





1. How can I add entries to an existing zip file in Java?    stackoverflow.com

Opening the file with a ZipOutputStream overwrites it. Is there a way to keep the file and just add new entries?

2. When creating a zip archive, what constitutes a duplicate entry    stackoverflow.com

In a Java web application I am creating a zip file from various in-memory files (stored as byte[]). Here's the key bit of code:

    ByteArrayOutputStream baos = new ByteArrayOutputStream();
 ...

3. Problem creating a multiple entry zip file with java    stackoverflow.com

ANyone know whats wrong with this code for creating a zip file containing a number of entries

    private File zipAttachments(List<File> licenses) throws IOException
    {
  ...

4. How can I find the file offset of a ZipFile entry in Java?    stackoverflow.com

I have a ZipFile and I'd like to create an array with the offsets/sizes of each entry in it. This is so that a C++ layer (JNI) can read these subfiles ...

5. Reading the contents of a zip entry from a zip that is in the form of bytes    stackoverflow.com

I'm calling onto some code that returns me an HTTP response. I can get the contents of the response which returns me a byte array. The bytes represent a ...

6. Updating ONE entry in a ZIP file    coderanch.com

Welcome to JavaRanch. The java.util.zip package has no provisions for modifying zip files; it can read or write them, but not update them. So one approach would be to read the complete file, write everything that's read to a different file, and make the changes you need to make where appropriate during the writing. Afterwards, if the new file was created ...

7. how to put two different folders(which is in different location) into one zip entry    coderanch.com

Hi Folks, I have log files in different location in my system say C:\\javaLog and D:\\cLog i need to compress these folders and put into a single zip file . How can i do this?. i tried with java.util.zip...but i cant make it exactly what i want.Please give me an idea .

8. Reading a Compressed File from a ZIP File, which is an entry of ZIP File    forums.oracle.com

Hello, Experts, Would it be possible somebody to help me with code example for the following problem? I want to read a compressed file from a ZIP file, which is an entry of ZIP File, without extacting/writing files on file system. Is this possible? Lets say we have a ZipFile1. There is ZipFile2 inside ZipFile1. And inside ZipFile2 is FileA. The ...

9. Zip Entries    forums.oracle.com





10. Removing a zip Entry for a ZipFile.    forums.oracle.com

I so far understand that this cannot be done. That is, it is not possible to remove a zipEntry from a ZipFile. Essentially I would have to rebuild the entire zip file If there is an Entry I do not want any longer. Tell me this isn't so. Any one have a work around? Any help would be appreciated.

11. java.util.zip.ZipFile.entries() shows only 99 files but zip file is fine.    forums.oracle.com

Hi, I have a wierd issue with java.util.zip.ZipFile Code as simple as ZipFile file = new ZipFile("my.zip") ; System.out.println(file.size()); For this particular zip file, it says 99 files found but the zip contains more than 60,000 files. I tried the zip with unzip and zip utilities and the zip file checks out fine. I even tried to unzip the contents, and ...