@@ -171,10 +171,9 @@ protected PostMethod createPostMethod(HttpInvokerClientConfiguration config) thr
171
171
172
172
/**
173
173
* Set the given serialized remote invocation as request body.
174
- * <p>The default implementation simply sets the serialized invocation
175
- * as the PostMethod's request body. This can be overridden, for example,
176
- * to write a specific encoding and potentially set appropriate HTTP
177
- * request headers.
174
+ * <p>The default implementation simply sets the serialized invocation as the
175
+ * PostMethod's request body. This can be overridden, for example, to write a
176
+ * specific encoding and to potentially set appropriate HTTP request headers.
178
177
* @param config the HTTP invoker configuration that specifies the target service
179
178
* @param postMethod the PostMethod to set the request body on
180
179
* @param baos the ByteArrayOutputStream that contains the serialized
@@ -228,11 +227,10 @@ protected void validateResponse(HttpInvokerClientConfiguration config, PostMetho
228
227
}
229
228
230
229
/**
231
- * Extract the response body from the given executed remote invocation
232
- * request.
233
- * <p>The default implementation simply fetches the PostMethod's response
234
- * body stream. If the response is recognized as GZIP response, the
235
- * InputStream will get wrapped in a GZIPInputStream.
230
+ * Extract the response body from the given executed remote invocation request.
231
+ * <p>The default implementation simply fetches the PostMethod's response body stream.
232
+ * If the response is recognized as GZIP response, the InputStream will get wrapped
233
+ * in a GZIPInputStream.
236
234
* @param config the HTTP invoker configuration that specifies the target service
237
235
* @param postMethod the PostMethod to read the response body from
238
236
* @return an InputStream for the response body
@@ -255,15 +253,15 @@ protected InputStream getResponseBody(HttpInvokerClientConfiguration config, Pos
255
253
256
254
/**
257
255
* Determine whether the given response indicates a GZIP response.
258
- * <p>Default implementation checks whether the HTTP "Content-Encoding"
256
+ * <p>The default implementation checks whether the HTTP "Content-Encoding"
259
257
* header contains "gzip" (in any casing).
260
258
* @param postMethod the PostMethod to check
261
259
* @return whether the given response indicates a GZIP response
262
260
*/
263
261
protected boolean isGzipResponse (PostMethod postMethod ) {
264
262
Header encodingHeader = postMethod .getResponseHeader (HTTP_HEADER_CONTENT_ENCODING );
265
263
return (encodingHeader != null && encodingHeader .getValue () != null &&
266
- encodingHeader .getValue ().toLowerCase ().indexOf (ENCODING_GZIP ) != - 1 );
264
+ encodingHeader .getValue ().toLowerCase ().contains (ENCODING_GZIP ));
267
265
}
268
266
269
267
}
0 commit comments