How do I load resource using Class Loader as File?

Posted by kunjaan on Stack Overflow See other posts from Stack Overflow or by kunjaan
Published on 2010-04-26T23:27:37Z Indexed on 2010/04/26 23:33 UTC
Read the original article Hit count: 234

Filed under:
|
|
|
|

I want to open files using the class loader. However I always get a FileNotFoundException. How do I create a new File using the URL? I don't want to open it as a stream just as a file.

URL url = VersionUpdater.class.getResource("xslt/screen/foo");
File f = ...

© Stack Overflow or respective owner

Related posts about java

Related posts about class-loader