I need the URI of a file (which I put in the resources directory). If I use
MyClass.class.getClassLoader().getResource(resource)
I get
java.lang.IllegalArgumentException: URI is not hierarchical
Otherwise, if I use ClassLoader.getSystemResource(resource)
it returns null
.