I am looking for a way to get a list of all resource names from a given classpath directory, something like a method List
Using Reflections
Get everything on the classpath:
Reflections reflections = new Reflections(null, new ResourcesScanner());
Set resourceList = reflections.getResources(x -> true);
Another example - get all files with extension .csv from some.package:
Reflections reflections = new Reflections("some.package", new ResourcesScanner());
Set fileNames = reflections.getResources(Pattern.compile(".*\\.csv"));