software-mariodiana
6/30/2016 - 7:10 PM

Getting a handle on a resource in a Jar file (without directly getting an InputStream) is tricky. Here's the way to do it: toExternalForm().

Getting a handle on a resource in a Jar file (without directly getting an InputStream) is tricky. Here's the way to do it: toExternalForm().

File f = new File(getClass().getResource("/MyResource").toExternalForm());