ZipOutputStream « Zip « Java I/O Q&A





1. Error opening zip file created using java    stackoverflow.com

I created a small application to read some files from the disk and zip it using java.util.zip.ZipOutputStream. It is successfully creating the zip file. But in windows when i try to ...

2. Closing ZipOutputStream    stackoverflow.com

I'm a bit confused. I know that an empty zip is not legal. But what about this sample snippet:

ZipOutputStream zos = null; 
try
{
    zos = new ZipOutputStream(new FileOutputStream("..."));
 ...

3. Is there a way in Java to preserve Created and Accessed attributes of a file when are added to a zip archive?    stackoverflow.com

I could handle the Modified (lastModified) attribute, meaning in the archive I could preserve the Modified attribute of the file.
Here is a sample:

ZipOutputStream out = new ZipOutputStream(new BufferedOutputStream( new FileOutputStream(outFilename)));
File f ...

4. Returning ZipOutputStream to browser    stackoverflow.com

I have an ZipOutputStream that I want to return to the browser. The experience I would like is that the user clicks an anchor tag, and then a file download prompt ...

5. java ZipOutputStream problem    stackoverflow.com

I am trying to write a java ZIP util class as below:

package fdbank.util;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;

/**
 * ??????
 * @author ggfan@amarsoft
 *
 */
public class ZIPUtil {

   ...

6. how to flush the ZipOutputStream periodically in java    stackoverflow.com

I am trying to archive list of files in zip format and then downloading it for the user on the fly... I am facing out of memory issue when downloading a zip ...

7. Java ZipOutputStream only deflate certain files / deflate filter    stackoverflow.com

This is a two part question, really. Preface: I use WinRAR to compress files. It gives you the option of only compressing certain files. I can filter by file extension ...

8. ZIPOutputStream's public void putNextEntry(ZipEntry e).    coderanch.com

Hi, I have question about ZIPOutputStream's public void putNextEntry(ZipEntry e). When we place a ZipEntry, the method puts this ZipEntry object in the beginning of the stream right? The one occupied beginning position prior to the method was placed behind this current one or is it deleted? The API says this method will close the old entry if it was still ...

9. ZipOutputStream and nested zip files    coderanch.com

I want to create a zip file that itself contains zip files. I'm assuming that I have to create the nested zip file on the file system. And then add it to the main zip file via ZipOutStream's putNextEntry(). And basically read in the nested file and write it out to the main zip file? Is this true? wanted to make ...





10. ZIPOutputStream's putNextEntry(ZipEntry e)    coderanch.com

Hi, I have question about ZIPOutputStream's public void putNextEntry(ZipEntry e). When we place a ZipEntry, the method puts this ZipEntry object in the beginning of the stream right? The one occupied beginning position prior to the method was placed behind this current one or is it deleted? The API says this method will close the old entry if it was still ...

11. Zipping files using ZipOutputStream    coderanch.com

I've a group of files and I'm trying to zip them all in a zip file using ZipOutputStream and ZipEntry classes. Everything is ok but I've a problem with arabic file names. When any of my files is named in arabic, it is put inside the zip file succesffully but the name is corrupted. I tried encoding the file name before ...

12. Creating a OS ZIP file using java.util.zip.ZipOutputStream    forums.oracle.com

The only way, which I presently know of, to write files and directory data into a Zip file using the ZipOutputStream Class, which only has methods which write bytes []. I create a ZipOutputStream Object with a FileOutputStream Object, creating a new Fred.zip file. DeflaterOutputStream says I write byte [] content, presumably per file, for every putNetEntry() ZipEntry call. this accomplishes ...