This Java tip illustrates a method of listing the contents of a ZIP file. Developer may use this as a functionality for its users to first see the contents of the ZIP file and then decompress the chosen one.
try {
ZipFile sourcefile = new ZipFile("source.zip");
for (Enumeration entries = sourcefile.entries(); entries.hasMoreElements();) {
String zipEntryName = ((ZipEntry)entries.nextElement()).getName();
}
} catch (IOException e) {
}
Source: java-tips.org
Tuesday, February 09, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment