private void attachResource(IResourceProvider resourceProvider) {
   for (String path : resourceProvider.getPaths()) {
     TemplateRoute templateRoute =
         router.attach(path, resourceProvider.getInboundRoot(router.getContext()));
     templateRoute.setMatchingMode(resourceProvider.getMatchingMode());
   }
 }
  public void unbindDefaultResourceProvider(IResourceProvider resourceProvider) {
    if (defaultRestletProvider == resourceProvider) {
      defaultRestletProvider = null;

      if (router != null) router.detach(resourceProvider.getInboundRoot(router.getContext()));
    }
  }
  public void bindDefaultResourceProvider(IResourceProvider resourceProvider) {
    defaultRestletProvider = resourceProvider;

    if (router != null) router.attachDefault(resourceProvider.getInboundRoot(router.getContext()));
  }
 public void unbindResourceProvider(IResourceProvider resourceProvider) {
   if (resourceProviders.remove(resourceProvider)) {
     if (router != null) router.detach(resourceProvider.getInboundRoot(router.getContext()));
   }
 }