Package com.sun.jersey.api.client

Examples of com.sun.jersey.api.client.ClientHandlerException


            byte[] requestEntity = out.toByteArray();
            printEntity(b, requestEntity);
            response.setEntityInputStream(new ByteArrayInputStream(requestEntity));
        } catch (IOException ex) {
            throw new ClientHandlerException(ex);
        }
        log(b);
    }
View Full Code Here


  private static ClientResponse mockClientResponse(TimelineClientImpl client,
      ClientResponse.Status status, boolean hasError, boolean hasRuntimeError) {
    ClientResponse response = mock(ClientResponse.class);
    if (hasRuntimeError) {
      doThrow(new ClientHandlerException(new ConnectException())).when(client)
          .doPostingEntities(any(TimelineEntities.class));
      return response;
    }
    doReturn(response).when(client)
        .doPostingEntities(any(TimelineEntities.class));
View Full Code Here

     */
    public ClientResponse handle(ClientRequest ro) {
        try {
            return _invoke(ro);
        } catch (Exception ex) {
            throw new ClientHandlerException(ex);
        }
    }
View Full Code Here

            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;
View Full Code Here

            byte[] requestEntity = out.toByteArray();
            printEntity(b, requestEntity);
            response.setEntityInputStream(new ByteArrayInputStream(requestEntity));
        } catch (IOException ex) {
            throw new ClientHandlerException(ex);
        }
        log(b);
    }
View Full Code Here

            response = getHttpClient().executeRequest(request);

            return getClientResponse(response.get());
        } catch (Exception e) {
            throw new ClientHandlerException(e);
        }
    }
View Full Code Here

                r.close();
            }

            return r;
        } catch (Exception e) {
            throw new ClientHandlerException(e);
        }
    }
View Full Code Here

                r.close();
            }

            return r;
        } catch (Exception e) {
            throw new ClientHandlerException(e);
        }

    }
View Full Code Here

        }

        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.");
        }

        // Set the read timeout
        final Integer readTimeout = (Integer) cr.getProperties().get(ApacheHttpClient4Config.PROPERTY_READ_TIMEOUT);
        if (readTimeout != null) {
View Full Code Here

        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");
        }
    }
View Full Code Here

TOP

Related Classes of com.sun.jersey.api.client.ClientHandlerException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.