We would like to know how to use ZipFile to list all entries in a zip file.
// w w w . j a v a 2 s .c o m import java.io.IOException; import java.util.Enumeration; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; public class MainClass { public static void main(String[] args) throws IOException { ZipFile zf = new ZipFile("test.zip"); Enumeration e = zf.entries(); while (e.hasMoreElements()) { ZipEntry ze2 = (ZipEntry) e.nextElement(); System.out.println("File: " + ze2); } } }