Read zip file with ZipInputStream : ZipInputStream « File « Java Tutorial






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

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());
  }
}








11.61.ZipInputStream
11.61.1.Create ZipInputStream from FileInputStream
11.61.2.Unzip using the ZipInputStream
11.61.3.Read zip file with ZipInputStream
11.61.4.Decompress a zip file using ZipInputStream