synchronized public void process(HttpResponse response, HttpContext context) throws HttpException, IOException { this.response = response; this.context = context; if(this.printheaders) printHeaders(); else if(this.response != null) { Header[] hdrs = this.response.getAllHeaders(); for(int i = 0; i < hdrs.length; i++) { headers.add(hdrs[i]); } } } }
static synchronized public void setInterceptors(boolean print) { if(!TESTING) throw new UnsupportedOperationException(); HTTPUtil.InterceptRequest rq = new HTTPUtil.InterceptRequest(); HTTPUtil.InterceptResponse rs = new HTTPUtil.InterceptResponse(); rq.setPrint(print); rs.setPrint(print); /* remove any previous */ for(int i = reqintercepts.size() - 1; i >= 0; i--) { HttpRequestInterceptor hr = reqintercepts.get(i); if(hr instanceof HTTPUtil.InterceptCommon) reqintercepts.remove(i); } for(int i = rspintercepts.size() - 1; i >= 0; i--) { HttpResponseInterceptor hr = rspintercepts.get(i); if(hr instanceof HTTPUtil.InterceptCommon) rspintercepts.remove(i); } reqintercepts.add(rq); rspintercepts.add(rs); }
static synchronized public void debugHeaders(boolean print) { HTTPUtil.InterceptRequest rq = new HTTPUtil.InterceptRequest(); HTTPUtil.InterceptResponse rs = new HTTPUtil.InterceptResponse(); rq.setPrint(print); rs.setPrint(print); /* remove any previous */ for(int i = reqintercepts.size() - 1;i >= 0;i--) { HttpRequestInterceptor hr = reqintercepts.get(i); if(hr instanceof HTTPUtil.InterceptCommon) reqintercepts.remove(i); } for(int i = rspintercepts.size() - 1;i >= 0;i--) { HttpResponseInterceptor hr = rspintercepts.get(i); if(hr instanceof HTTPUtil.InterceptCommon) rspintercepts.remove(i); } reqintercepts.add(rq); rspintercepts.add(rs); }
synchronized public void process(HttpResponse response, HttpContext context) throws HttpException, IOException { this.response = response; this.context = context; if(this.printheaders) printHeaders(); else if(this.response != null) { Header[] hdrs = this.response.getAllHeaders(); for(int i = 0;i < hdrs.length;i++) headers.add(hdrs[i]); } } }