478479480481482483484485
} return revalidateCacheEntry(target, request, context, entry); } catch (IOException ioex) { return handleRevalidationFailure(request, context, entry, now); } catch (ProtocolException e) { throw new ClientProtocolException(e); } }
141142143144145146147148
response.removeHeaders("Content-Encoding"); response.removeHeaders("Content-MD5"); } return response; } catch (HttpException e) { throw new ClientProtocolException(e); } }
812813814815816817818819820821822
URI requestURI = request.getURI(); if (requestURI.isAbsolute()) { target = URIUtils.extractHost(requestURI); if (target == null) { throw new ClientProtocolException( "URI does not specify a valid host name: " + requestURI); } } return target; }
904905906907908909910911
return out; } else { return director.execute(target, request, execContext); } } catch(HttpException httpException) { throw new ClientProtocolException(httpException); } }
252253254255256257258259260261262
throws ClientProtocolException { RequestWrapper newRequest; try { newRequest = new RequestWrapper(request); } catch (ProtocolException pe) { throw new ClientProtocolException(pe); } newRequest.setProtocolVersion(version); return newRequest; }
265266267268269270271272273274275
872873874875876877878879880881882
} @Test public void testNonCompliantRequestWrapsAndReThrowsProtocolException() throws Exception { ClientProtocolException expected = new ClientProtocolException("ouch"); requestIsFatallyNonCompliant(null); requestCannotBeMadeCompliantThrows(expected); boolean gotException = false;
137138139140141142143144145146147
for (int i = 0; i < this.count; i++) { HttpResponse response = this.httpclient.execute(this.target, this.request); int status = response.getStatusLine().getStatusCode(); if (status != 200) { this.request.abort(); throw new ClientProtocolException("Unexpected status code: " + status); } HttpEntity entity = response.getEntity(); if (entity != null) { entity.consumeContent(); }
5455565758596061626364
protected File process( final HttpResponse response, final File file, final ContentType contentType) throws Exception { if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) { throw new ClientProtocolException("Upload failed: " + response.getStatusLine()); } return file; } };
401402403404405406407408
} futureCallback.failed(e); } }); } catch (final ProtocolException e) { throw new ClientProtocolException(e); } }