Skip to content

Commit 9958895

Browse files
committed
polishing
1 parent a2129a1 commit 9958895

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

org.springframework.web/src/main/java/org/springframework/remoting/httpinvoker/CommonsHttpInvokerRequestExecutor.java

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,9 @@ protected PostMethod createPostMethod(HttpInvokerClientConfiguration config) thr
171171

172172
/**
173173
* 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.
178177
* @param config the HTTP invoker configuration that specifies the target service
179178
* @param postMethod the PostMethod to set the request body on
180179
* @param baos the ByteArrayOutputStream that contains the serialized
@@ -228,11 +227,10 @@ protected void validateResponse(HttpInvokerClientConfiguration config, PostMetho
228227
}
229228

230229
/**
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.
236234
* @param config the HTTP invoker configuration that specifies the target service
237235
* @param postMethod the PostMethod to read the response body from
238236
* @return an InputStream for the response body
@@ -255,15 +253,15 @@ protected InputStream getResponseBody(HttpInvokerClientConfiguration config, Pos
255253

256254
/**
257255
* 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"
259257
* header contains "gzip" (in any casing).
260258
* @param postMethod the PostMethod to check
261259
* @return whether the given response indicates a GZIP response
262260
*/
263261
protected boolean isGzipResponse(PostMethod postMethod) {
264262
Header encodingHeader = postMethod.getResponseHeader(HTTP_HEADER_CONTENT_ENCODING);
265263
return (encodingHeader != null && encodingHeader.getValue() != null &&
266-
encodingHeader.getValue().toLowerCase().indexOf(ENCODING_GZIP) != -1);
264+
encodingHeader.getValue().toLowerCase().contains(ENCODING_GZIP));
267265
}
268266

269267
}

0 commit comments

Comments
 (0)