public File extractTheme(File zip) throws Exception {
        final int BUFFER = 2048;
        int count;
        String tmpFilePath = System.getProperty("java.io.tmpdir");
        File outDir = new File(tmpFilePath, getFilename(zip) + System.currentTimeMillis());
        byte data[] = new byte[BUFFER];
        outDir.mkdirs();
        ZipFile zipF = new ZipFile(zip);
        Enumeration entries = zipF.entries();
        while(entries.hasMoreElements()) {
            ZipEntry entry = (ZipEntry)entries.nextElement();
            if(entry.isDirectory()) {
                File dir = new File(outDir, entry.getName());
                dir.mkdirs();
            } else {
                InputStream is = zipF.getInputStream(entry);
                File out = new File(outDir, entry.getName());
                if(!out.getParentFile().isDirectory()) {
                    out.getParentFile().mkdirs();
                }
                FileOutputStream fos = new FileOutputStream(out);
                while ((count = is.read(data,0,BUFFER)) != -1) {
                     fos.write(data,0,count);
                }
                fos.flush();
                fos.close();
                is.close();
            }
        }
        zipF.close();
        return outDir;
    }