有人知道在Jar文件中迭代类的2-3行解决方案吗?
(我手中有一个java.net.URL实例)
谢谢
发布于 2010-03-03 19:52:59
Accessing zips and jars using Java Part 1
Accessing zips and jars using Java Part 2
以下是第一篇文章中的代码片段:
ZipFile zip = new ZipFile(fileName);
// Process the zip file. Close it when the block is exited.
try {
// Loop through the zip entries and print the name of each one.
for (Enumeration list = zip.entries(); list.hasMoreElements(); ) {
ZipEntry entry = (ZipEntry) list.nextElement();
System.out.println(entry.getName());
}
}
finally {
zip.close();
}发布于 2010-03-03 19:59:31
jar -tf xyz.jar|grep类
Here's a solution。您可以从URL而不是代码使用的文件创建输入流。
https://stackoverflow.com/questions/2370867
复制相似问题