Here you can find the source of getSimpleName(ZipEntry entry)
public static String getSimpleName(ZipEntry entry)
//package com.java2s; //License from project: Apache License import java.util.zip.ZipEntry; public class Main { public static String getSimpleName(ZipEntry entry) { return getSimpleName(entry.getName()); }//from w w w . jav a 2s .co m public static String getSimpleName(String entryName) { if (entryName.endsWith("/")) { final int lastIndex = entryName.length() - 2; final int firstIndex = entryName.lastIndexOf("/", lastIndex);// -1 as last index and -1 to remove / return firstIndex == -1 ? entryName.substring(0, lastIndex + 1) : entryName.substring(firstIndex + 1, lastIndex + 1); } else { final int firstIndex = entryName.lastIndexOf("/"); return firstIndex == -1 ? entryName : entryName .substring(firstIndex + 1); } } }