Search in sources :

Example 21 with ClientResponse

use of org.glassfish.jersey.client.ClientResponse in project jersey by jersey.

the class InMemoryConnector method createClientResponse.

private ClientResponse createClientResponse(final ClientRequest clientRequest, final InMemoryResponseWriter responseWriter) {
    final ClientResponse clientResponse = new ClientResponse(responseWriter.getStatusInfo(), clientRequest);
    clientResponse.getHeaders().putAll(responseWriter.getHeaders());
    clientResponse.setEntityStream(new ByteArrayInputStream(responseWriter.getEntity()));
    return clientResponse;
}
Also used : ClientResponse(org.glassfish.jersey.client.ClientResponse) ByteArrayInputStream(java.io.ByteArrayInputStream)

Aggregations

ClientResponse (org.glassfish.jersey.client.ClientResponse)21 ProcessingException (javax.ws.rs.ProcessingException)10 IOException (java.io.IOException)7 CompletableFuture (java.util.concurrent.CompletableFuture)7 Response (javax.ws.rs.core.Response)7 ClientRequest (org.glassfish.jersey.client.ClientRequest)6 ByteArrayInputStream (java.io.ByteArrayInputStream)4 Map (java.util.Map)3 Header (org.apache.http.Header)3 CloseableHttpResponse (org.apache.http.client.methods.CloseableHttpResponse)3 Test (org.junit.Test)3 URI (java.net.URI)2 List (java.util.List)2 CancellationException (java.util.concurrent.CancellationException)2 ExecutionException (java.util.concurrent.ExecutionException)2 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)2 AtomicReference (java.util.concurrent.atomic.AtomicReference)2 Client (javax.ws.rs.client.Client)2 HttpEntity (org.apache.http.HttpEntity)2 HttpUriRequest (org.apache.http.client.methods.HttpUriRequest)2