public static void unzipFileIntoDirectory(ZipFile zipFile, File directory) {
        Enumeration files = zipFile.entries();
        while (files.hasMoreElements()) {
            try {
                ZipEntry entry = (ZipEntry) files.nextElement();
                InputStream inputStream = zipFile.getInputStream(entry);
                byte[] buffer = new byte[1024];
                int bytesRead;
                File file = new File(directory.getAbsolutePath() + File.separator + entry.getName());

                if (entry.isDirectory()) {
                    file.mkdirs();
                    continue;
                } else {
                    file.getParentFile().mkdirs();
                    file.createNewFile();
                }

                FileOutputStream fileOutputStream = new FileOutputStream(file);
                while ((bytesRead = inputStream.read(buffer)) != -1) {
                    fileOutputStream.write(buffer, 0, bytesRead);
                }
                fileOutputStream.close();
            } catch (IOException ex) {
                ex.printStackTrace();
            }
        }
        try {
            zipFile.close();
        } catch (IOException ex) {
            ex.printStackTrace();
        }
    }