Here you can find the source of uncompress(File zipFile, File folder)
public static void uncompress(File zipFile, File folder)
//package com.java2s; //License from project: Open Source License import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; public class Main { public static void uncompress(File zipFile, File folder) { try (FileInputStream inputStream = new FileInputStream(zipFile)) { ZipInputStream zip = new ZipInputStream(inputStream); ZipEntry entry;/*www . ja va 2 s . c o m*/ byte[] buffer = new byte[1024]; while ((entry = zip.getNextEntry()) != null) { File file = new File(folder, entry.getName()); File entryfolder = file.getParentFile(); if (!entryfolder.exists()) { entryfolder.mkdirs(); } try (FileOutputStream fos = new FileOutputStream(file)) { int len; while ((len = zip.read(buffer)) > 0) { fos.write(buffer, 0, len); } } } zip.close(); } catch (IOException e) { throw new RuntimeException(e.getMessage(), e); } } }