> Hi all, here's a basic question I haven't been able to find the answer to.
>
[quoted text clipped - 3 lines]
> classLoader (or I guess any other method) locate the JAR file being
> executed so it can load some resources?
> Mark Space wrote on 17.03.2007 16:44:
>>
[quoted text clipped - 5 lines]
>
> getClass().getResourceAsStream()
I was probably unclear with that last bit. I mean resources
generically, not specificaly a Java Resource.
Let's say I want to muck with the class search order, loading classes
from my package space first from the current JAR. Then defaulting to
the parent classLoader only if the class isn't found locally.
Hmm, is a class a resource? I haven't actually tested this yet.
Can I getResourceX("/classes/MyPackage/subpackage/MyClass.class"); ?
Thomas Kellerer - 17 Mar 2007 18:07 GMT
Mark Space wrote on 17.03.2007 17:42:
>> Mark Space wrote on 17.03.2007 16:44:
>>>
[quoted text clipped - 8 lines]
> I was probably unclear with that last bit. I mean resources
> generically, not specificaly a Java Resource.
What do you mean with "Java Resource"?
Any file in the .jar can be loaded using the stream returned by
getResourceAsStream().
Joshua Cranmer - 17 Mar 2007 18:10 GMT
>> Mark Space wrote on 17.03.2007 16:44:
>>>
[quoted text clipped - 16 lines]
>
> Can I getResourceX("/classes/MyPackage/subpackage/MyClass.class"); ?
Why don't you test it to find out? You could answer your own question.
I believe the answer is yes, although this is a spur-of-the-moment,
untested answer, whose validity should not be trusted.