class FileHelper {

    public static boolean unzipFile(String outputDirectory, File zipFile) throws FileNotFoundException, IOException {
        FileInputStream fis = new FileInputStream(zipFile);
        ZipInputStream zis = null;
        BufferedOutputStream dest = null;
        try {
            zis = new ZipInputStream(new BufferedInputStream(fis));
            ZipEntry entry = null;


            final int BUFFER = 2048;
            while ((entry = zis.getNextEntry()) != null) {
                String fileName = entry.getName();
                int count = 0;
                byte data[] = new byte[BUFFER];
                // Get the final filename (even if it's within directories in the ZIP file)
                String destinationFileName = entry.getName().contains(File.pathSeparator) ? entry.getName().substring(entry.getName().lastIndexOf(File.pathSeparator)) : entry.getName();
                String destinationPath = outputDirectory + java.io.File.separator + destinationFileName;
                FileOutputStream fos = new FileOutputStream(destinationPath);
                dest = new BufferedOutputStream(fos, BUFFER);
                log.debug(new StringBuilder("Unzipping: ").append(fileName).append(" to ").append(destinationPath).toString());
                while ((count = zis.read(data, 0, BUFFER)) != -1) {
                    dest.write(data, 0, count);
                }
                dest.flush();
                dest.close();
                log.trace(new StringBuilder("Unzipped: ").append(fileName).append(" to ").append(destinationPath).toString());
            }
        } finally {
            if (zis != null) {
                IOUtils.closeQuietly(zis);
            }
            if (dest != null) {
                IOUtils.closeQuietly(dest);
            }
        }
        return true;
    }

}