Created
September 29, 2010 08:19
-
-
Save anonymous/602451 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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