I have writen a custom ClassLoader now to load from an alternative
"customised class path". However I have come unstuck with getting 
resources. My custom class loader can get a class from a zip or jar file 
just as the primordal can

Basically I writing ClassLoader.getResourceAsStream() is easy.
My problem is writing ClassLoader.getResource() returns a URL.

I want my custom class loader to emulate the primordial class loader and
dip in a zip file and be able to return a URL to it.

I noticed that the primordial class loader getResource() returns a URLs
such as:

        systemresource:/ZIP0/+/docs/Author.html
        systemresource:/FILE1/+/very/nice/Computer.class

Can any one, especially those privy to JVM implementation, explain this
URL format? What is going on internally?

If you obtain this form of URL and thus call URL.openConnection() the
default URL protocol handler can find the resource and return an 
InputStream to it. HOWEVER IT ONLY EVEN FIND RESOURCES THAT ARE IN
THE ORIGINAL "CLASSPATH". 
Do I have to write URLStreamHandler object myself?

Peter


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to