Java examples for File Path IO:Zip File
List Contents Of Zip File
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 w ww . j a v a 2 s. co m*/ ZipFile zipFile = new ZipFile("c:/Folder/Files.zip"); Enumeration e = zipFile.entries(); System.out.println("Listing zip file contents"); while (e.hasMoreElements()) { ZipEntry entry = (ZipEntry) e.nextElement(); System.out.println(entry.getName()); } } catch (IOException ioe) { System.out.println("Error opening zip file" + ioe); } } }