Hi Alex, > This is different in that I need to use the ClassLoader associated > with a class instance. So, I need to pass MyApp.class and there is > no way to make a URI to that resource without reconstructing > the jar URL.
Agreed. You need to pass a ClassLoader instance to the CLAP connector which can't be done via a URI string AFAIK. > Because the code is being setup *inside* the code loaded from > the jar file, I have no idea what the jar URL should be. Further, the > class loaded could use multiple jar files and so there isn't a way > to construct one URI. OK. > All that complexity is avoided by using: > > MyApp.class.getResourceAsStream(path); > > I'm testing some code right now for this and I'll try to post > an example later. Following our side discussion, I've added the following solution that should let you use the Directory with the CLAP URIs while still providing your custom classloader instance. If you set the special attribute name "org.restlet.clap.classloader" on the Request instances handled by the Directory, the CLAP connector will use the provided ClassLoader instance to load the target CLAP resources. You can set this attribute by using a custom Filter set-up in your Application.createRoot() method. Enhancement checked in SVN trunk. Let me know if this works for you. Best regards, Jerome

