如这样一个目录/Users/xxx/IdeaProjects/abc/web/target/web.jar!/BOOT-INF/lib/rest-0.0.1.jar!/com/tg/tiny
/Users/xxx/IdeaProjects/abc/web/target/web.jar
这个jar包下的文件目录可以这样得到
JarFile localJarFile = new JarFile(new File("/Users/xxx/IdeaProjects/abc/web/target/web.jar"));
Enumeration<JarEntry> entries = localJarFile.entries();
while (entries.hasMoreElements()) {
JarEntry jarEntry = entries.nextElement();
System.out.println(jarEntry.getName());
}
那么这个web.jar
里的rest-0.0.1.jar下的文件目录如何得到?
A jar package is a file. Not a directory.
Need to pass classloader’s getResourceAsStream().
Detailed usage:
http://www.myexception.cn/pro...