Here you can find the source of getZipEntry(ZipFile jarFile, String path)
public static ZipEntry getZipEntry(ZipFile jarFile, String path)
//package com.java2s; /*/*from www . j a v a 2 s . co m*/ * SK's Minecraft Launcher * Copyright (C) 2010-2014 Albert Pham <http://www.sk89q.com> and contributors * Please see LICENSE.txt for license information. */ import java.util.*; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; public class Main { public static ZipEntry getZipEntry(ZipFile jarFile, String path) { Enumeration<? extends ZipEntry> entries = jarFile.entries(); String expected = normalizePath(path); while (entries.hasMoreElements()) { ZipEntry entry = entries.nextElement(); String test = normalizePath(entry.getName()); if (expected.equals(test)) { return entry; } } return null; } public static String normalizePath(String path) { return path.replaceAll("^[/\\\\]*", "").replaceAll("[/\\\\]+", "/"); } }