How to change the folder structure when exporting. [message #461091] |
Fri, 05 January 2007 01:30 |
Eclipse User |
|
|
|
Originally posted by: filot97.nate.com
When I export my rcp application, I see the following folder structure.
\myRCP\
\feature\
\plugin\
\myplugin.jar
...
Above is not the same as my development folder.
I create a foo folder. Next, when I export, it is packaged in myplugin.jar. If I write the code that reference a specific resource in the foo folder, it will throw run time exception.
How can I solve this problem?
|
|
|
|
Re: How to change the folder structure when exporting. [message #461099 is a reply to message #461093] |
Fri, 05 January 2007 03:11 |
Eclipse User |
|
|
|
Originally posted by: wegener.cboenospam.com
Alex Blewitt wrote:
> If you load the resource with class.getResourceAsStream("foo/file.txt") then it should work, regardless of whether it's packaged up as a Jar or not.
>
> Alex.
If foo is at the root of the plugin folder, you need to include a '/' as
in "/foo/file.txt". Otherwise foo is added at the end of the package of
the Class used to call the getResourceAsStream method. If called from
com.somepackage.AClass, the class loader will look for the file
"com/somepackage/foo/file.txt".
|
|
|
|
Powered by
FUDForum. Page generated in 0.03081 seconds