/** * Checks if a zip file contains a specified entry name. * * @param file the zip file * @param entryName The content to be checked * @return True if the file contains entryName. False otherwise */ public static boolean hasEntry(File file, String entryName) throws IOException { List<String> elements = getEntryNames(file); return elements.contains(entryName); }
public static boolean hasEntry(InputStream stream, String entryName) throws IOException { List<String> elements = getEntryNames(stream); return elements.contains(entryName); }
public static List<String> getEntryNames(URL url) throws IOException { return getEntryNames(url.openStream()); }