protected void handleLocal(Request request, Response response,
String decodedPath) {
String scheme = request.getResourceRef().getScheme();
if (scheme.equalsIgnoreCase(Protocol.CLAP.getSchemeName())) {
LocalReference cr = new LocalReference(request.getResourceRef());
ClassLoader classLoader = null;
if ((cr.getClapAuthorityType() == LocalReference.CLAP_CLASS)
|| (cr.getClapAuthorityType() == LocalReference.CLAP_DEFAULT)) {
// Sometimes, a specific class loader needs to be used,
// make sure that it can be provided as a request's attribute
Object classLoaderAttribute = request.getAttributes().get(
"org.restlet.clap.classLoader");
if (classLoaderAttribute != null) {
classLoader = (ClassLoader) classLoaderAttribute;
} else {
// Old name to be deprecated
classLoaderAttribute = request.getAttributes().get(
"org.restlet.clap.classloader");
if (classLoaderAttribute != null) {
classLoader = (ClassLoader) classLoaderAttribute;
} else {
classLoader = getClass().getClassLoader();
}
}
} else if (cr.getClapAuthorityType() == LocalReference.CLAP_SYSTEM) {
classLoader = ClassLoader.getSystemClassLoader();
} else if (cr.getClapAuthorityType() == LocalReference.CLAP_THREAD) {
classLoader = Thread.currentThread().getContextClassLoader();
}
handleClassLoader(request, response, classLoader);
} else {