> Paul Reavis wrote:
> >
> > Juergen Kreileder wrote:
> > >
> > > >>>>> Bernd Wengenroth writes:
> > >
> > > > Hello, I want to load class-files with the
> > > > ClassLoader.getResourceAsStream( String )-methode.
> > > > i.e. xxx.getResourceAsStream( "package/myClass.class" );
> > >
> > > > It's works fine on files without a ".class"-postfix. But files with
> > > > this prefix are not opened (the methode reports null). If i copy
> > > > the same file to the same directory, but without the postfix, the
> > > > stream is returned as expected.
> > >
> > > > Any hints ?
> > >
> > > That's a security feature, you can't get classes with getResource.
> >
> > And you should be able to get around it with a custom classloader (which
> > isn't as hard to implement as you might think).
>
> *smile*, that exactly what i want.
> I want to speed up the start of plugin-applications with an own
> class-loader.
> I start with a very small preloader, that can display some more custom
> "loading..."-Messages while the main part of the application is loaded
> from a huge jar-file.
> But i don't want to load ALL classes at startup.
> Some classes should be loaded on demand from a server.
> I think i must do this with a direct file-access ;)
>
>
I think there a few examples in
"Java Examples In A Nutshell"
By David Flanagan, O'Reilly
www.ora.com
Cheers
Peter
--
import java.std.disclaimer.*; // "Dontcha just love the API, baby bop!"
Peter Pilgrim Dept:OTC Derivatives IT,
Deutsche Bank (UK) Ltd, Groundfloor 133 Houndsditch, London, EC3A 7DX
Tel: +44-545-8000 Direct: +44 (0)171-545-9977 Fax: 0171-545-4313
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-