I'm trying to load all resources containing a certain pattern (e.g. *.properties) from classpath. Therefore I've tried to use
ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
ArrayList<URL> resources = Collections.list(classLoader.getResources(""));
resources.add(classLoader.getResource("org"));
In the next step I iterated through the list of URL-resources, create a proper java.nio.FileSystem and use a PathMatcher to find the required resources.
This solution does not work for the following reason:
- resources in the root-directory will not be found since
classloader.getResource()does not work with"",nullor/ - the prod-profile of course behaves completly different to the dev-profile
Is there a way in Quarkus to load a list of resources from classpath using a pattern.
thanks in advance & best regards