Inside my WEB application there is a classpath or resource directory with JSON and text files.
/classes/mydir/a.json
/classes/mydir/b.json
/classes/mydir/b.txt
/classes/mydir/xyz.json
I need a InputStream
(to give to Jackson JSON ObjectMapper
) to all JSON files in this directory.
I do a
URL dirUrl = getClass().getResource("/mydir");
which gives me
vfs:/content/mywar.war/WEB-INF/classes/mydir/
Which is the correct directory but any next step using toUri, File or nio classes complains that 'vfs' is not supported.
Are there any (JBoss/EAP) utility classes to read resources from the classpath inside a JBoss EAP or can someone give an example to do a JSON file listing of a classpath directory? Hopefully not using yet another dependency.
Runtime: JBoss EAP 7.1.4.GA (WildFly Core 3.0.17.Final-redhat-1)
Java: 1.8.0_191-b12