Scott Green wrote:
Can someone give a answer? I dont think it is good idea we put all
configuration/resources under "conf" dir.

On 1/15/07, Scott Green <[EMAIL PROTECTED]> wrote:
Hi,

I need to load some resources from mine plugin's sub-directory. Any
avaiable method to get the specified plugin's root directory now?
thanks

You need to make sure that this resource is packaged into the plugin jar (just see how it's done in other plugins). Then you should be able to access it through the ClassLoader that loaded this plugin, e.g.

package a.b.c;

public class MyPlugin {
...
   InputStream is = MyPlugin.class.getResourceAsStream("myResource.txt");
...
}

--
Best regards,
Andrzej Bialecki     <><
___. ___ ___ ___ _ _   __________________________________
[__ || __|__/|__||\/|  Information Retrieval, Semantic Web
___|||__||  \|  ||  |  Embedded Unix, System Integration
http://www.sigram.com  Contact: info at sigram dot com


Reply via email to