Java examples for File Path IO:Zip File
Get Zip Entry
import java.io.IOException; import java.util.Enumeration; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; public class Main { public static void main(String args[]) { try {//from ww w . j ava2 s . c om ZipFile zipFile = new ZipFile("c:/Folder/WebFiles.zip"); Enumeration e = zipFile.entries(); while (e.hasMoreElements()) { ZipEntry entry = (ZipEntry) e.nextElement(); String comment = entry.getComment(); if ("".equals(comment)) System.out.println(comment + " found for entry " + entry.getName()); else System.out.println("No comments found for entry " + entry.getName()); } zipFile.close(); } catch (IOException ioe) { System.out.println("Error opening zip file" + ioe); } } }