Here you can find the source of unzip(File file, File dest)
public static void unzip(File file, File dest) throws IOException, ZipException
//package com.java2s; //License from project: Open Source License import java.io.*; import java.util.Enumeration; import java.util.zip.ZipEntry; import java.util.zip.ZipException; import java.util.zip.ZipFile; public class Main { public static void unzip(File file, File dest) throws IOException, ZipException { ZipFile zipFile = new ZipFile(file); Enumeration<? extends ZipEntry> entries = zipFile.entries(); while (entries.hasMoreElements()) { ZipEntry entry = entries.nextElement(); File entryDest = new File(dest, entry.getName()); if (entry.isDirectory()) { entryDest.mkdir();//from w ww . ja va 2s .c om } else { entryDest.getParentFile().mkdirs(); BufferedInputStream bin = new BufferedInputStream(zipFile.getInputStream(entry)); int length; BufferedOutputStream bout = new BufferedOutputStream(new FileOutputStream(entryDest)); while ((length = bin.read()) != -1) { bout.write(length); } bout.close(); } } } }