我正在使用org.reflections library查找资源包中的资源:
new Reflections(
"test", //package prefix
new ResourcesScanner()
).getResources(x -> x.endsWith(".xml"))
在添加具有相似名称的包之前,它工作正常。例如
它只是包test
并添加了包test_second
:
|
+-+-[test]
| +--one.xml
| +--two.xml
|
+-+-[test_second]
+--three.xml
+--four.xml
现在,当我尝试按前缀扫描时,会找到两个包中的资源。
问题:如何使用此库仅扫描“test”包中的资源,并忽略所有其他包含“test”前缀的包?