I need to get a File object (not a Stream) to pass to a library. I am getting "URI is not hierarchical". I have seen some solutions but they either are rather inefficient or use external libraries.
File myFile = new File(MyClass.class.getClassLoader().getResource(dir).toURI())
By the way, I need the object to pass to
Lucene FSDirectory.open(myFile)
Any idea?