I have a Maven project with some .bpmn files in /src/main/resources/bpmn which I am struggling to load into my Java app. This loading process occurs inside a .jar file which is loaded at runtime by a .war web app.
I have tried:
MyClass.class.getClassLoader().getResourceAsStream("/bpmn"); and
MyClass.class.getResourceAsStream("/bpmn");
which returns an input stream which I've constructed a BufferedReader from:
new BufferedReader(new InputStreamReader(inputStream));
But when I go to read the lines, there's nothing. I was expecting that when I read the lines it would output the names of the files in that folder.
If I try
MyClass.class.getClassLoader().getResource("/bpmn");
and print the URL, it returns the correct path, but when I try and construct a file object, I get a java.lang.IllegalArgumentException: URI is not hierarchical.
Would someone be able to point me in the right direction?
Thank you