Get Entry from a zip file : GZIPInputStream « File « Java Tutorial






import java.io.FileInputStream;
import java.util.Date;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;

public class ZipReader {
  public static void main(String[] args) throws Exception {
    ZipInputStream zis = null;

    FileInputStream fis = new FileInputStream(args[0]);
    zis = new ZipInputStream(fis);

    ZipEntry ze;

    while ((ze = zis.getNextEntry()) != null)
      System.out.println(ze.getName() + "  [" + ze.getSize() + "]  ["
          + new Date(ze.getTime()).toString() + "]");
  }
}








11.65.GZIPInputStream
11.65.1.Create GZIPInputStream from FileInputStream
11.65.2.Unzip a file with GZIPInputStream
11.65.3.Ugzip using GZIPInputStream
11.65.4.Get Entry from a zip file