且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用通配符名称发现Java jar中的资源?

更新时间:2023-01-10 11:54:38

这需要一点点诡计,但这里有一个相关的博客条目。首先找出罐子的URL,然后打开罐子并扫描其内容。我想你会通过查找`/META-INF/MANIFEST.MF'来发现所有罐子的URL。目录将是另一回事。

It requires a little trickery, but here's an relevant blog entry. You first figure out the URLs of the jars, then open the jar and scan its contents. I think you would discover the URLs of all jars by looking for `/META-INF/MANIFEST.MF'. Directories would be another matter.