This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: Security exception when using resource-url in an applet
- From: Per Bothner <per at bothner dot com>
- To: kawa at sourceware dot org
- Date: Sat, 05 Jun 2010 15:20:25 -0700
- Subject: Re: Security exception when using resource-url in an applet
- References: <C8304038.25247%lexaay@gmail.com>
On 06/05/2010 02:56 AM, alex mitchell wrote:
I'm trying to load a text file from an applet. I've put the text file into
the same .jar file as the applet. I'm planning to use resource-url to get
the URL of the file, and then open-input-file with the URL, but at this
point all I'm doing is getting the URL.
resource-url creates a magic URL using a custom URLStreamHandler.
Unfortunately, it appears you can't do that in applets.
We probably need to switch to using the standard getResource
mechanism directly.
The easiest fix wouldbe to just change module-uri for class
FOO to do FOO.class.getResource("FOO.class"). I'm not sure
what the downsides of that would be - I need to remind myself
why I implemented the class-resource: URL scheme.
--
--Per Bothner
per@bothner.com http://per.bothner.com/