Ejemplo n.º 1
0
  @Override
  public void readMembers(RequestContext ctx, ResourceSink sink) throws Exception {

    ResourceParams resourceParams = ctx.resourceParams();
    if (resourceParams != null && resourceParams.value(TARGET_PARAMETER) != null) {
      String target = resourceParams.value(TARGET_PARAMETER);
      for (Script script : scripts.getByTarget(target)) {
        sink.accept(new ResourceScript(this, script));
      }

    } else {

      for (Script script : scripts.values()) {
        sink.accept(new ResourceScript(this, script));
      }
    }
    sink.close();
  }
Ejemplo n.º 2
0
 @Override
 public void readMembers(RequestContext ctx, ResourceSink sink) {
   this.fires
       .stream()
       .forEach(
           (e) -> {
             sink.accept(e);
           });
   sink.close();
 }
Ejemplo n.º 3
0
 @Override
 public void readMembers(RequestContext ctx, ResourceSink sink) {
   this.resources
       .values()
       .forEach(
           (e) -> {
             sink.accept(e);
           });
   try {
     sink.close();
   } catch (Exception e) {
     e.printStackTrace(); // To change body of catch statement use File | Settings | File
     // Templates.
   }
 }
Ejemplo n.º 4
0
 @Override
 public void readMembers(RequestContext ctx, ResourceSink sink) throws Exception {
   sink.accept(scriptFileResource);
   sink.close();
 }