Retrieve the contents of a ZIP file
import java.util.Enumeration; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; public class Main { public static void main(String[] argv) throws Exception { ZipFile sourcefile = new ZipFile("source.zip"); for (Enumeration entries = sourcefile.entries(); entries.hasMoreElements();) { String zipEntryName = ((ZipEntry) entries.nextElement()).getName(); System.out.println(zipEntryName); } } }