Here you can find the source of unZip(File zipFile, String extPlace, boolean reservZipFile)
public static void unZip(File zipFile, String extPlace, boolean reservZipFile) throws IOException
//package com.java2s; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; public class Main { public static void unZip(File zipFile, String extPlace, boolean reservZipFile) throws IOException { ZipInputStream in = new ZipInputStream(new FileInputStream(zipFile)); ZipEntry entry = null;//ww w .j a va 2s .c om while ((entry = in.getNextEntry()) != null) { String entryName = entry.getName(); if (entry.isDirectory()) { File file = new File(extPlace + entryName); file.mkdirs(); } else { File file = new File(extPlace + entryName); if (!file.isFile()) { file = file.getAbsoluteFile(); File parent = file.getParentFile(); if (!parent.exists()) { parent.mkdirs(); } } OutputStream os = new FileOutputStream(extPlace + entryName); byte[] buf = new byte[1024]; int len; while ((len = in.read(buf)) > 0) { os.write(buf, 0, len); } os.close(); in.closeEntry(); } } in.close(); if (!reservZipFile) { zipFile.delete(); } } }