From fd513425a1f87c9ee9b9c7d4700d72f9ffa827fb Mon Sep 17 00:00:00 2001 From: Sebastian Bazley Date: Sat, 1 May 2010 15:47:02 +0000 Subject: [PATCH] Unthrown Exceptions git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@940061 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/http/client/cache/impl/CachingHttpClient.java | 3 +-- .../client/cache/impl/SizeLimitedResponseReader.java | 9 ++++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/httpclient-cache/src/main/java/org/apache/http/client/cache/impl/CachingHttpClient.java b/httpclient-cache/src/main/java/org/apache/http/client/cache/impl/CachingHttpClient.java index df963af01..0d18f4cb6 100644 --- a/httpclient-cache/src/main/java/org/apache/http/client/cache/impl/CachingHttpClient.java +++ b/httpclient-cache/src/main/java/org/apache/http/client/cache/impl/CachingHttpClient.java @@ -435,8 +435,7 @@ public class CachingHttpClient implements HttpClient { return backendResponse; } - protected SizeLimitedResponseReader getResponseReader(HttpResponse backEndResponse) - throws IOException { + protected SizeLimitedResponseReader getResponseReader(HttpResponse backEndResponse) { return new SizeLimitedResponseReader(maxObjectSizeBytes, backEndResponse); } diff --git a/httpclient-cache/src/main/java/org/apache/http/client/cache/impl/SizeLimitedResponseReader.java b/httpclient-cache/src/main/java/org/apache/http/client/cache/impl/SizeLimitedResponseReader.java index 5d4282b0a..cb6c819af 100644 --- a/httpclient-cache/src/main/java/org/apache/http/client/cache/impl/SizeLimitedResponseReader.java +++ b/httpclient-cache/src/main/java/org/apache/http/client/cache/impl/SizeLimitedResponseReader.java @@ -52,8 +52,7 @@ public class SizeLimitedResponseReader { private byte[] sizeLimitedContent; private boolean outputStreamConsumed; - public SizeLimitedResponseReader(int maxResponseSizeBytes, HttpResponse response) - throws IOException { + public SizeLimitedResponseReader(int maxResponseSizeBytes, HttpResponse response) { this.maxResponseSizeBytes = maxResponseSizeBytes; this.response = response; } @@ -116,14 +115,14 @@ public class SizeLimitedResponseReader { return sizeLimitedContent; } - public HttpResponse getReconstructedResponse() throws IOException { + public HttpResponse getReconstructedResponse() { InputStream combinedStream = getCombinedInputStream(); return constructResponse(response, combinedStream); } - protected InputStream getCombinedInputStream() throws IOException { + protected InputStream getCombinedInputStream() { InputStream input1 = new ByteArrayInputStream(getResponseBytes()); InputStream input2 = getContentInputStream(); return new CombinedInputStream(input1, input2); @@ -134,7 +133,7 @@ public class SizeLimitedResponseReader { } protected HttpResponse constructResponse(HttpResponse originalResponse, - InputStream combinedStream) throws IOException { + InputStream combinedStream) { HttpResponse response = new BasicHttpResponse(originalResponse.getProtocolVersion(), HttpStatus.SC_OK, "Success");