Here you can find the source of unzip(ZipEntry entry, ZipFile zipfile, File explodedDir)
public static void unzip(ZipEntry entry, ZipFile zipfile, File explodedDir) throws IOException
//package com.java2s; //License from project: Apache License import com.google.common.io.ByteStreams; import java.io.*; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; public class Main { public static void unzip(ZipEntry entry, ZipFile zipfile, File explodedDir) throws IOException { if (entry.isDirectory()) { new File(explodedDir, entry.getName()).mkdirs(); return; }//from ww w. ja v a 2 s . c om File outputFile = new File(explodedDir, entry.getName()); if (!outputFile.getParentFile().exists()) { outputFile.getParentFile().mkdirs(); } BufferedInputStream inputStream = new BufferedInputStream(zipfile.getInputStream(entry)); BufferedOutputStream outputStream = new BufferedOutputStream(new FileOutputStream(outputFile)); try { ByteStreams.copy(inputStream, outputStream); } finally { outputStream.close(); inputStream.close(); } } }