Skip to content

Instantly share code, notes, and snippets.

Created September 29, 2010 08:19
Show Gist options
  • Save anonymous/602451 to your computer and use it in GitHub Desktop.
Save anonymous/602451 to your computer and use it in GitHub Desktop.
@Override
public Restlet createRoot() {
final Router router = new Router(getContext());
getConnectorService().getClientProtocols().add(Protocol.FILE);
getConnectorService().getClientProtocols().add(Protocol.CLAP);
LocalReference localReference = LocalReference.createClapReference(LocalReference.CLAP_THREAD, "/src/main/webapp/");
CompositeClassLoader customCL = new CompositeClassLoader();
customCL.addClassLoader(Thread.currentThread().getContextClassLoader());
customCL.addClassLoader(Router.class.getClassLoader());
ClassLoaderDirectory directory = new ClassLoaderDirectory(getContext(),
localReference,
customCL);
router.attach("/www", directory);
return router;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment