List of utility methods to do Jar Entry
String | constructClassName(JarEntry je) construct Class Name int n = je.getName().length() - ".class".length(); return je.getName().replace("/", ".").substring(0, n); |
JarEntry | getJarEntry(JarFile file, String entryName) Find the specified entry in the specified JAR file return file.getJarEntry(entryName);
|
boolean | hasClassEntry(JarFile jarFile, String className) has Class Entry String path = className.replace('.', '/') + ".class"; return jarFile.getEntry(path) != null; |
boolean | inClasspath(Collection in Classpath for (String s : classpath) { if (entry.getName().startsWith(s)) { return true; return false; |
boolean | isJavaClass(JarEntry je) is Java Class return je.getName().endsWith(".class"); |
boolean | isJavaLibrary(JarEntry entry) is Java Library return entry.getName().toLowerCase().endsWith(".jar") || entry.getName().toLowerCase().endsWith(".zip"); |
boolean | isNativeLibrary(JarEntry entry) is Native Library String name = entry.getName(); int dotSeperatorPosition = name.lastIndexOf('.'); if (dotSeperatorPosition <= 0) { return false; String type = name.substring(dotSeperatorPosition + 1); if (NATIVE_LIB_FILE_TYPES.contains(type)) { return true; ... |
String | parseSimpleName(JarEntry entry) Returns the name of a JAR or ZIP entry without the path. int index = entry.getName().lastIndexOf("/"); String simpleName; if (index > 0) { simpleName = entry.getName().substring(index); } else { simpleName = entry.getName(); if (!simpleName.endsWith(".jar") && !simpleName.endsWith(".zip")) { ... |
String | trimEntryName(JarEntry je) trim Entry Name String[] s = je.getName().toLowerCase().replace(".htm", "").split("/"); return s[s.length - 1]; |