if (EncodingType.isSupported(encodingName))
/** * Chooses the first encoding in the given list of supported encodings that the client can compress with. * This assumes that the service listed the encodings in order of preference. * * @param serverSupportedEncodings list of compression encodings the server supports. * @return the encoding name that should be used to compress requests. */ private static EncodingType getRestRequestContentEncoding(List<String> serverSupportedEncodings) { for (String encoding: serverSupportedEncodings) { if (EncodingType.isSupported(encoding)) { return EncodingType.get(encoding); } } return EncodingType.IDENTITY; }
/** * @return the compression schemas that the client will support for response compression */ private EncodingType[] buildRestAcceptEncodingSchemaNames(List<String> encodings) { if (encodings != null) { List<EncodingType> encodingTypes = new ArrayList<EncodingType>(); for (String encoding : encodings) { if (EncodingType.isSupported(encoding)) { encodingTypes.add(EncodingType.get(encoding)); } } return encodingTypes.toArray(new EncodingType[encodingTypes.size()]); } return DEFAULT_RESPONSE_CONTENT_ENCODINGS; }
if (EncodingType.isSupported(encodingName))