Code example for ZipEntry

Methods: getNameisDirectory

0
        delegate.close();
    } 
 
    private static void extract(ZipInputStream in, ZipEntry entry, File root)
            throws IOException {
        if (!entry.isDirectory()) { // create the directtory
            File file = new File(root, entry.getName());
            if (!file.getParentFile().mkdirs()) { // make sure all parent
                                                  // directory exists 
                throw new IOException("Failed to create directory: "
                        + file.getParent());
            } 
            // write the file content 
            FileOutputStream out = new FileOutputStream(file);
            try { 
                FileUtils.copy(in, out);
            } finally { 
                out.close();
            } 
        }