I have some Resources working, but I can't seem to get a static
Directory working. Does this look right?
public class ControlApp extends Application
{
@Override
public synchronized Restlet createRoot()
{
Router router = new Router(getContext());
// resource routes work
router.attach("/user/{login}/foo", FooResource.class);
router.attach("/user/{login}/foo/{fooID}", FooResource.class);
// static files do not work
String ROOT_URI = "file:///tmp/";
Directory d = new Directory(getContext(), ROOT_URI);
d.setListingAllowed(true);
d.setDeeplyAccessible(true);
router.attach("/images", d);
return router;
}
}
Yes, I added the FILE protocol to the component.
component.getServers().add(Protocol.HTTP, 8182);
component.getClients().add(Protocol.FILE);
Thanks,
tlc
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2388941