|
Re: access file within plug-in? [message #335755 is a reply to message #335754] |
Mon, 27 April 2009 15:28 |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
The easiest way is to make sure it is in your classpath (i.e. you put it
into your source folder for the plugin) and then just use standard java
access:
URL url = SomeClassInYourPlugin.getResource("/path to resource");
or
InputStream is = SomeClassInYourPlugin.getResourceAsStream("/path to
resource");
where SomeClassInYourPlugin is some class in your plugin.
Matt Anderson wrote:
> Hello,
>
> I have a plug-in that currently accesses a configurable, but runtime
> static XML file. I would like to move the file from the directory where
> it is stored and zip it up with the plugin itself. Is there a way for a
> plug-in at runtime to access files within its plugin? Maybe something
> in the plugin.xml that would make the file visible to the code?
>
> Just wondering,
>
> Thanks,
>
> Matt A
>
--
Thanks,
Rich Kulp
|
|
|
Powered by
FUDForum. Page generated in 0.03092 seconds