Java tutorial
//package com.java2s; //License from project: Apache License import java.io.File; import java.util.Enumeration; import java.util.HashMap; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; public class Main { public static ZipFile readZipEntriesForElectric(File archive, final HashMap<String, ZipEntry> compressionEntries) { ZipFile zipfile = null; try { zipfile = new ZipFile(archive); for (Enumeration<?> e = zipfile.entries(); e.hasMoreElements();) { ZipEntry entry = (ZipEntry) e.nextElement(); if (!entry.getName().contains("MACOSX")) { compressionEntries.put(entry.getName(), entry); } } } catch (Exception e) { e.printStackTrace(); } finally { } return zipfile; } }