Monday, 21 March 2011

Retrieve the contents of a ZIP file

try {
// Open the ZIP file
ZipFile sourcefile = new ZipFile("source.zip");

// Enumerate each entry
for (Enumeration entries = sourcefile.entries(); entries.hasMoreElements();) {
// Get the entry name
String zipEntryName = ((ZipEntry)entries.nextElement()).getName();
}
} catch (IOException e) {
}

No comments:

Post a Comment