static synchronized public void setGlobalCompression(String compressors) { if(globalsettings.get(Prop.COMPRESSION) != null) removeGlobalCompression(); String compresslist = checkCompressors(compressors); if(HTTPUtil.nullify(compresslist) == null) throw new IllegalArgumentException("Bad compressors: " + compressors); globalsettings.put(Prop.COMPRESSION, compresslist); HttpResponseInterceptor hrsi; if(compresslist.contains("gzip")) { hrsi = new GZIPResponseInterceptor(); rspintercepts.add(hrsi); } if(compresslist.contains("deflate")) { hrsi = new DeflateResponseInterceptor(); rspintercepts.add(hrsi); } }
protected TestCase(String filename, boolean overwrite, String target) { super(null); this.filename = HTTPUtil.canonicalpath(filename); this.status = ""; this.overwrite = overwrite; this.target = HTTPUtil.canonicalpath(HTTPUtil.nullify(target)); try { this.file = HTTPUtil.readbinaryfile(new File(filename)); } catch (IOException ioe) { throw new IllegalArgumentException(ioe); } }