Index: google-http-client/src/main/java/com/google/api/client/http/json/JsonHttpRequest.java |
=================================================================== |
--- a/google-http-client/src/main/java/com/google/api/client/http/json/JsonHttpRequest.java |
+++ b/google-http-client/src/main/java/com/google/api/client/http/json/JsonHttpRequest.java |
@@ -158,10 +158,19 @@ |
* override if specific behavior is required. |
* |
* <p> |
- * Callers are responsible for closing the response's content input stream by calling |
- * {@link HttpResponse#ignore}. |
+ * Callers are responsible for disconnecting the HTTP response by calling |
+ * {@link HttpResponse#disconnect}. Example usage: |
* </p> |
* |
+ * <pre> |
+ HttpResponse response = jsonHttpRequest.executeUnparsed(); |
+ try { |
+ // process response.. |
+ } finally { |
+ response.disconnect(); |
+ } |
+ * </pre> |
+ * |
* @return the {@link HttpResponse} |
* @throws IOException if the request fails |
*/ |
@@ -177,9 +186,18 @@ |
* Subclasses may override if specific behavior is required. |
* |
* <p> |
- * Callers are responsible for closing the input stream. |
+ * Callers are responsible for closing the input stream after it is processed. Example sample: |
* </p> |
* |
+ * <pre> |
+ InputStream is = request.executeAsInputStream(); |
+ try { |
+ // Process input stream.. |
+ } finally { |
+ is.close(); |
+ } |
+ * </pre> |
+ * |
* @return input stream of the response content |
* @throws IOException if the request fails |
* @since 1.8 |