Hi,

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.

Thanks.

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();       }


Reply via email to