123124125126127128129130
*/ public ClientResponse handle(ClientRequest ro) { try { return _invoke(ro); } catch (Exception ex) { throw new ClientHandlerException(ex); } }
123124125126127128129130131132133
if (encodings.equals("gzip")) { response.getHeaders().remove(HttpHeaders.CONTENT_ENCODING); try { response.setEntityInputStream(new GZIPInputStream(response.getEntityInputStream())); } catch (IOException ex) { throw new ClientHandlerException(ex); } } } return response;
226227228229230231232233234
byte[] requestEntity = out.toByteArray(); printEntity(b, requestEntity); response.setEntityInputStream(new ByteArrayInputStream(requestEntity)); } catch (IOException ex) { throw new ClientHandlerException(ex); } log(b); }
282283284285286287288289290
if (proxy instanceof URI) { return (URI) proxy; } else if (proxy instanceof String) { return URI.create((String) proxy); } else { throw new ClientHandlerException("The proxy URI (" + ApacheHttpClient4Config.PROPERTY_PROXY_URI + ") property MUST be an instance of String or URI"); } }
187188189190191192193194195
r.close(); } return r; } catch (Exception e) { throw new ClientHandlerException(e); } }
232233234235236237238239240241
} if(entity != null && request instanceof HttpEntityEnclosingRequestBase) { ((HttpEntityEnclosingRequestBase) request).setEntity(entity); } else if (entity != null) { throw new ClientHandlerException("Adding entity to http method " + cr.getMethod() + " is not supported."); } return request; }
241242243244245246247248
response = getHttpClient().executeRequest(request); return getClientResponse(response.get()); } catch (Exception e) { throw new ClientHandlerException(e); } }
262263264265266267268269
255256257258259260261262
}); return jerseyFuture; } catch (IOException e) { throw new ClientHandlerException(e); } }
184185186187188189190191
r.close(); } return r; } catch (Exception e) { method.releaseConnection(); throw new ClientHandlerException(e); } }