Best practice? Add resources to eclipse plugin [message #271889] |
Wed, 01 July 2009 06:19  |
Eclipse User |
|
|
|
Hi,
I have a problem to open a file in a eclipse plugin application.
I create following structure:
src/main/java/
mwoelm.pmc.ModelCompilation.java
...
src/main/resources/
template/aspect.tpl
I try to open the aspect.tpl file in the ModelCompilation class:
URL url = this.getClass().getResource("/template/aspect.tpl");
System.out.println(url);
FileReader fr = new FileReader(new File(url.getPath()));
...
This works, if I start this application standalone java application, but
if I start the plugin in a workbench I get:
bundleresource://406.fwk22048196/template/aspect.tpl
java.io.FileNotFoundException: /template/aspect.tpl (No such file or
directory)
Any advice?
Best regards,
miwoe
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.07902 seconds