/** * Set compressable mime-type list List contains users agents separated by * ',' : * * ie: "text/html,text/xml,text/plain" * * @param compressableMimeTypes */ public void setCompressableMimeTypes(String compressableMimeTypes) { if (compressableMimeTypes != null) { this.compressableMimeTypes = null; StringTokenizer st = new StringTokenizer(compressableMimeTypes, ","); while (st.hasMoreTokens()) { addCompressableMimeType(st.nextToken().trim()); } } }
/** * Set no compression user agent list. List contains users agents separated * by ',' : * * ie: "gorilla,desesplorer,tigrus" * * @param noCompressionUserAgents */ public void setNoCompressionUserAgents(String noCompressionUserAgents) { if (noCompressionUserAgents != null) { StringTokenizer st = new StringTokenizer(noCompressionUserAgents, ","); while (st.hasMoreTokens()) { addNoCompressionUserAgent(st.nextToken().trim()); } } }
/** * Set restricted user agent list (which will downgrade the connector to * HTTP/1.0 mode). List contains users agents separated by ',' : * * ie: "gorilla,desesplorer,tigrus" * * @param restrictedUserAgents */ public void setRestrictedUserAgents(String restrictedUserAgents) { if (restrictedUserAgents != null) { StringTokenizer st = new StringTokenizer(restrictedUserAgents, ","); while (st.hasMoreTokens()) { addRestrictedUserAgent(st.nextToken().trim()); } } }
/** * Add user-agent for which gzip compression didn't works The user agent * String given will be exactly matched to the user-agent header submitted * by the client. * * @param userAgent * user-agent string */ public void addNoCompressionUserAgent(String userAgent) { try { Pattern nRule = Pattern.compile(userAgent); noCompressionUserAgents = addREArray(noCompressionUserAgents, nRule); } catch (PatternSyntaxException pse) { CoyoteLogger.HTTP_LOGGER.errorParsingRegexp(userAgent, pse); } }
/** * Add a mime-type which will be compressable The mime-type String will be * exactly matched in the response mime-type header . * * @param mimeType * mime-type string */ public void addCompressableMimeType(String mimeType) { compressableMimeTypes = addStringArray(compressableMimeTypes, mimeType); }
public void recycle() { inputBuffer.recycle(); outputBuffer.recycle(); this.channel = null; super.recycle(); }
return (startsWithStringArray(compressableMimeTypes, response.getContentType()));
/** * Add restricted user-agent (which will downgrade the connector to HTTP/1.0 * mode). The user agent String given will be matched via regexp to the * user-agent header submitted by the client. * * @param userAgent * user-agent string */ public void addRestrictedUserAgent(String userAgent) { try { Pattern nRule = Pattern.compile(userAgent); restrictedUserAgents = addREArray(restrictedUserAgents, nRule); } catch (PatternSyntaxException pse) { CoyoteLogger.HTTP_LOGGER.errorParsingRegexp(userAgent, pse); } }