I need to access a file inside the currently executed .jar using a URL.
URL url = BlockConverter.class.getResource(\"/test.txt\");
System.out.println(url.toStrin
I would open it as a stream directly e.g.
InputStream is = BlockConverter.class.getResourceAsStream("/test.txt");
The above method is the way I normally access resources within a jar (it will open the resource regardless of it being packaged within a jar, or simply as an unpackaged deployment, note)