Get all Resources with certain postfix in package (jar)

Viewed 36

I'd like the have all jasper files in the given package:

ResourcePatternResolver res = new PathMatchingResourcePatternResolver();
res.getResources("classpath*:path/to/some/package/**/*.jasper");

All I get is an empty array.

When I try the pattern

"classpath*:**/*.jasper"

It finds all jasper files in the whole jar. What am I doing wrong?

1 Answers

I found the solution myself...

res.getResources("classpath*:**/path/to/some/package/**/*.jasper");

Adding ** in front of the path solved the problem

Related