Package net.sf.sahi.stream.filter

Examples of net.sf.sahi.stream.filter.StreamFilter


  }

  private InputStream applyFilters(InputStream in) {
    Iterator<StreamFilter> iter = this.filters.iterator();
    while (iter.hasNext()){
      StreamFilter filter = iter.next();
//      in = filter.filter(in);
      in = new StreamFilterInputStream(in, filter); // Contributed by [Richard Li]
    }
    return in;
  }
View Full Code Here


  }

  private void modifyHeadersViaFilters(HttpResponse response){
    Iterator<StreamFilter> iter = this.filters.iterator();
    while (iter.hasNext()){
      StreamFilter filter = iter.next();
      try {
        filter.modifyHeaders(response);
      } catch (IOException e) {
        e.printStackTrace();
      }
    }
  }
View Full Code Here

      simpleHttpResponse.removeHeader("Cache-Control");
      assertEquals(null, simpleHttpResponse.headers().getHeader("Cache-Control"));
    HttpModifiedResponse resp = new HttpModifiedResponse(simpleHttpResponse, false, "js");
    List<StreamFilter> filters = resp.getFilters();
    for (Iterator<StreamFilter> iterator = filters.iterator(); iterator.hasNext();) {
      StreamFilter streamFilter = iterator.next();
      if (streamFilter instanceof NoCacheFilter) {
        fail("Should not have added NoCacheFilter");
      }
    }   
    }   
View Full Code Here

      String s = "<html><head></head></html>";
      SimpleHttpResponse simpleHttpResponse = new SimpleHttpResponse(s);
    HttpModifiedResponse resp = new HttpModifiedResponse(simpleHttpResponse, false, "htm");
    List<StreamFilter> filters = resp.getFilters();
    for (Iterator<StreamFilter> iterator = filters.iterator(); iterator.hasNext();) {
      StreamFilter streamFilter = iterator.next();
      if (streamFilter instanceof NoCacheFilter) {
        return;
      }
    }
    fail("Should have added NoCacheFilter");
View Full Code Here

TOP

Related Classes of net.sf.sahi.stream.filter.StreamFilter

Copyright © 2018 www.massapicom. 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.