import java.io.*; import java.util.zip.*; ZipInputStream in = null; OutputStream out = null; ZipEntry ze = null; String folderPath = (String) context.get("varCurrentBatchFolder"); try { in = new ZipInputStream(inputStream); while( (ze = in.getNextEntry() ) != null ){ try{ System.out.println("Extracting : "+ze); int len; byte[] buf = new byte[1024]; out = new FileOutputStream(folderPath +ze.getName()); while ((len = in.read(buf)) > 0) out.write(buf, 0, len); out.flush(); } finally { try { if (out != null) out.close(); } catch (IOException e) { service.getLogger().error("Output stream can not be closed : " + e.getMessage(), e); throw e; } } } } catch (Exception e) { service.getLogger().error("Error while decompression : " + e.getMessage(), e); throw e; }