/** extract zip file */ public void extract(String outputDir) throws IOException { org.apache.commons.compress.archivers.zip.ZipFile file = null; InputStream in = null; OutputStream out = null; try { file = new org.apache.commons.compress.archivers.zip.ZipFile(fileName, fileEncoding); Enumeration<ZipArchiveEntry> entries = file.getEntries(); while (entries.hasMoreElements()) { ZipArchiveEntry entry = entries.nextElement(); String entryName = entry.getName(); if (entry.isDirectory()) { forceMkdir(new File(outputDir + File.separator + entryName)); continue; } out = openOutputStream(new File(outputDir + File.separator + entryName)); in = file.getInputStream(entry); copy(in, out); closeQuietly(in); closeQuietly(out); } } finally { closeQuietly(in); closeQuietly(out); org.apache.commons.compress.archivers.zip.ZipFile.closeQuietly(file); } }