Package org.apache.shindig.gadgets.rewrite

Examples of org.apache.shindig.gadgets.rewrite.ResponseRewriter.rewrite()


  private String rewrite(HttpRequest request, HttpResponse response) throws Exception {
    request.setSanitizationRequested(true);
    ResponseRewriter rewriter = createRewriter();

    HttpResponseBuilder hrb = new HttpResponseBuilder(parser, response);
    rewriter.rewrite(request, hrb);
    return hrb.getContent();
  }

  private ResponseRewriter createRewriter() {
    return new CajaResponseRewriter(new RequestPipeline() {
View Full Code Here


    request.setSanitizationRequested(true);
    ResponseRewriter rewriter = createRewriter(Collections.<String>emptySet(),
        Collections.<String>emptySet());

    HttpResponseBuilder hrb = new HttpResponseBuilder(parser, response);
    rewriter.rewrite(request, hrb);
    if (hrb.getNumChanges() == 0) {
      return null;
    }
    return hrb.getContent();
  }
View Full Code Here

  private String rewrite(HttpRequest request, HttpResponse response, Gadget gadget) throws Exception {
    request.setSanitizationRequested(true);
    ResponseRewriter rewriter = createRewriter();

    HttpResponseBuilder hrb = new HttpResponseBuilder(parser, response);
    rewriter.rewrite(request, hrb, gadget);
    return hrb.getContent();
  }

  private ResponseRewriter createRewriter() {
    return new CajaResponseRewriter(new RequestPipeline() {
View Full Code Here

    request.setSanitizationRequested(true);
    ResponseRewriter rewriter = createRewriter(Collections.<String>emptySet(),
        Collections.<String>emptySet());

    HttpResponseBuilder hrb = new HttpResponseBuilder(parser, response);
    rewriter.rewrite(request, hrb, gadget);
    if (hrb.getNumChanges() == 0) {
      return null;
    }
    return hrb.getContent();
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.