예제 #1
0
 @Override
 public void readMember(RequestContext ctx, String id, Responder responder) throws Exception {
   if (scriptFileResource != null && id.equals(scriptFileResource.id())) {
     responder.resourceRead(scriptFileResource);
   } else {
     responder.noSuchResource(id);
   }
 }
예제 #2
0
 @Override
 public void readMember(RequestContext ctx, String id, Responder responder) throws Exception {
   Script script = scripts.get(id);
   if (script != null) {
     responder.resourceRead(new ResourceScript(this, script));
   } else {
     responder.noSuchResource(id);
   }
 }
예제 #3
0
  @Override
  public void readMember(RequestContext ctx, String id, Responder responder) {
    try {
      if (id == null) {
        responder.resourceRead(this);
        return;
      }

      if (!this.resources.containsKey(id)) {
        responder.noSuchResource(id);
        return;
      }

      responder.resourceRead(this.resources.get(id));

    } catch (Throwable t) {
      responder.internalError(t.getMessage());
    }
  }