Rickard,
you even don't need all tha access controll stuff. Just package beans and
resources in the same jar file, it'll work withoud any intervention and will
keep things simple.
You can read this from the javadoc of java.io.FilePermission of JDK1.2.2:
<java-doc>
Please note: Code can always read a file from the same directory it's in (or a
subdirectory of that directory); it does not need
explicit permission to do so.
</java-doc>
I hope this helps.
Rickard �berg wrote:
> FYI, the workaround I am using currently is to have a library with a
> function that can read the resource. This library has the required
> permission, and can be called from the bean. Something like this:
> public InputStream getResource(final String name, final Object
> requestor)
> {
> return (InputStream)AccessController.doPrivileged(new
> PrivilegedAction()
> {
> public Object run()
> {
> return
> requestor.getClass().getClassLoader().getResourceAsStream(name);
> }
> });
> }
> -----------------
>
> Works. Good?
>
> BTW, as you can see I have to provide the caller in order to get to the
> classloader. If it was mandatory that the classloader is available
> through Thread.currentThread().getContextClassLoader() then this would
> not be necessary. Any thoughts on this?
>
> /Rickard
>
> --
> Rickard �berg
>
> @home: +46 13 177937
> Email: [EMAIL PROTECTED]
> http://www.dreambean.com
> Question reality
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff EJB-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
--
Francis Pouatcha
MATHEMA Software GmbH
http://www.mathema.de
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".