Here you can find the source of unzip(File inputFile, File unzipDestFolder)
public static void unzip(File inputFile, File unzipDestFolder) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.util.Enumeration; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; public class Main { public static void unzip(File inputFile, File unzipDestFolder) throws IOException { ZipFile zipFile = null;/*from w w w . j av a2 s .com*/ InputStream inputStream = null; try { zipFile = new ZipFile(inputFile); Enumeration<? extends ZipEntry> oEnum = zipFile.entries(); while (oEnum.hasMoreElements()) { ZipEntry zipEntry = oEnum.nextElement(); File file = new File(unzipDestFolder, zipEntry.getName()); if (zipEntry.isDirectory() && !file.exists()) { file.mkdirs(); } else { if (!file.getParentFile().exists()) { file.getParentFile().mkdirs(); } inputStream = zipFile.getInputStream(zipEntry); BufferedInputStream buffInputStream = new BufferedInputStream(inputStream); FileOutputStream fos = new FileOutputStream(file); BufferedOutputStream bos = new BufferedOutputStream(fos); int byteData; while ((byteData = buffInputStream.read()) != -1) { bos.write((byte) byteData); } bos.close(); fos.close(); buffInputStream.close(); } } } catch (IOException ioException) { throw ioException; } finally { try { if (zipFile != null) { zipFile.close(); } if (inputStream != null) { inputStream.close(); } } catch (IOException ioException) { } } } }