atom feed3 messages in org.tigris.restlet.discussUnable to get static files
FromSent OnAttachments 3, 2008 1:53 am 
Rob HeittmanJun 3, 2008 7:35 am 3, 2008 9:08 am 
Subject:Unable to get static files (
Date:Jun 3, 2008 1:53:14 am


I'm trying to get a static file c:\workspace\api\docs\index.html without success. I use 1.1 sapshot.

What am i doing wrong.


my code:

public ApiApplication(Context context) {super(context);}

@Override public synchronized Restlet createRoot() { Router router = new Router(getContext());

getConnectorService().getClientProtocols().add(Protocol.FILE); // though it is loaded by default LocalReference lr = LocalReference.createFileReference("C:\\workspace\\ApiServer\\docs\\"); Directory dir = new Directory(getContext(), lr); router.attach("/docs", dir); return router; }

public static void main(String[] args) throws Exception { // Create a component with an HTTP server connector Component comp = new Component(); comp.getServers().add(Protocol.HTTP, 4444);

// Attach the application to the default host and start it comp.getDefaultHost().attach("", new ApiApplication(comp.getContext())); comp.start(); }