Here you can find the source of unzip(File aFile)
public static void unzip(File aFile)
//package com.java2s; import java.io.*; import java.util.zip.*; public class Main { /**/*from w ww.java 2 s . c om*/ * Unzips the given file into the destination file. */ public static void unzip(File aFile) { // Catch exceptions try { // Get new file input stream for file FileInputStream fis = new FileInputStream(aFile); // Get zip input stream ZipInputStream zis = new ZipInputStream(fis); // Create stream buffer byte buffer[] = new byte[8192]; // Iterate over zip entries for (ZipEntry entry = zis.getNextEntry(); entry != null; entry = zis.getNextEntry()) { // Get entry output file File outputFile = new File(aFile.getParent(), entry.getName()); // If directory, just create and skip if (entry.isDirectory()) { outputFile.mkdir(); continue; } // Write the files to the disk FileOutputStream fos = new FileOutputStream(outputFile); BufferedOutputStream dest = new BufferedOutputStream(fos, 8192); for (int count = zis.read(buffer, 0, 8192); count != -1; count = zis.read(buffer, 0, 8192)) dest.write(buffer, 0, count); // Flush and close output stream dest.flush(); dest.close(); } // Close zip zis.close(); // Catch exceptions } catch (IOException e) { e.printStackTrace(); } } }