Here you can find the source of UnZipFolder(String zipFileString, String outPathString)
public static void UnZipFolder(String zipFileString, String outPathString) throws Exception
//package com.java2s; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; public class Main { public static void UnZipFolder(String zipFileString, String outPathString) throws Exception { ZipInputStream inZip = new ZipInputStream(new FileInputStream( zipFileString));//from ww w. j a va 2s. com ZipEntry zipEntry; String szName = ""; while ((zipEntry = inZip.getNextEntry()) != null) { szName = zipEntry.getName(); if (zipEntry.isDirectory()) { // get the folder name of the widget szName = szName.substring(0, szName.length() - 1); File folder = new File(outPathString + File.separator + szName); folder.mkdirs(); } else { File file = new File(outPathString + File.separator + szName); File parent = file.getParentFile(); if (!parent.exists()) { parent.mkdirs(); } file.createNewFile(); // get the output stream of the file FileOutputStream out = new FileOutputStream(file); int len; byte[] buffer = new byte[1024]; // read (len) bytes into buffer while ((len = inZip.read(buffer)) != -1) { // write (len) byte from buffer at the position 0 out.write(buffer, 0, len); out.flush(); } out.close(); } }// end of while inZip.close(); } }