How can I discover resources in a Java jar with a wildcard name?

前端 未结 5 580
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-18 02:55

I want to discover all xml files that my ClassLoader is aware of using a wildcard pattern. Is there any way to do this?

5条回答
  •  温柔的废话
    2021-01-18 03:22

    Well, it is not from within Java, but

    jar -tvf jarname | grep xml$

    will show you all the XMLs in the jar.

提交回复
热议问题