How do I access a plugin file in the java code?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How do I access a plugin file in the java code?

Erik Ramfelt
I got an XSL file in the plugin that is needed in a
Publishers.perform() action. I can access it through the resource
bundle as a URL, but how does that work when it is being performed on
a slave machine? What is the proper way to include a none-web file in
a plugin and then access it? Should I read it as an InputStream and
buffer it as I need to access it several times?

//Erik

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: How do I access a plugin file in the java code?

Kohsuke Kawaguchi
Administrator
Erik Ramfelt wrote:
> I got an XSL file in the plugin that is needed in a
> Publishers.perform() action. I can access it through the resource
> bundle as a URL, but how does that work when it is being performed on
> a slave machine?

No difference. Just use Class.getResource().

 > What is the proper way to include a none-web file in
> a plugin and then access it? Should I read it as an InputStream and
> buffer it as I need to access it several times?

ClassLoader will do the caching properly. No need for you to worry about
anything.


--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment