Monday, March 21, 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

Chitika