On Fri, 1 Dec 2000, Rickard �berg wrote:
> If only... the problem is not reading the XML files, in which case the
> above works well. The problem is URLClassLoader, which messes things up
> bigtime, i.e. loading the classes. And that is unavoidable (even if you
> try to give it your own URL stream handler it happily throws that away
> and uses the default jar handler, which is f*d up).
>
> So, no go.
What I'm suggesting is that we use a custom ClassLoader instead of
the URLClassLoader for JAR files on disk (only).
So, go. :)
Seriously, I've done this with JARs containing classes and
resources. What I actually did was create a JarFile and load all the
files into memory and then release the classes as they were loaded by the
(custom) ClassLoader, but we could do something more memory-efficient for
resource files if we need to. If you do this, you can move or delete the
original JAR file, or replace it with another one and then start another
ClassLoader using that JarFile, etc. Tested on Windows too, and you can
avoid the unfortunate JAR-file locks there.
Aaron