Here you can find the source of unzipEntryToFolder(ZipEntry entry, InputStream zis, File destFolder)
public static File unzipEntryToFolder(ZipEntry entry, InputStream zis, File destFolder) throws FileNotFoundException, IOException
//package com.java2s; //License from project: Apache License import java.io.BufferedOutputStream; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.util.zip.ZipEntry; public class Main { private static int BUFFER = 2048; public static File unzipEntryToFolder(ZipEntry entry, InputStream zis, File destFolder) throws FileNotFoundException, IOException { BufferedOutputStream dest; if (entry.isDirectory()) { File destFile = new File(destFolder, entry.getName()); destFile.mkdirs();//from w w w . ja v a 2s . c om return destFile; } else { int count; byte data[] = new byte[BUFFER]; // write the files to the disk File destFile = new File(destFolder, entry.getName()); File parentFolder = destFile.getParentFile(); if (!parentFolder.exists()) parentFolder.mkdirs(); FileOutputStream fos = new FileOutputStream(destFile); dest = new BufferedOutputStream(fos, BUFFER); while ((count = zis.read(data, 0, BUFFER)) != -1) { dest.write(data, 0, count); } dest.flush(); dest.close(); return destFile; } } }