An alternative is the getResource method from the Java classloader:
File myResource;
try{
final URL resource = getClass().getClassLoader().getResource("MY_RESOURCE");
if(resource != null){
myResource = new File(resource.toURI());
}
} catch(URISyntaxException e){
//something went wrong
}
No comments:
Post a Comment
With great power comes great responsibility