org.jboss.resteasy.client.jaxrs.internal.ClientResponse Maven / Gradle / Ivy
package org.jboss.resteasy.client.jaxrs.internal;
import org.jboss.resteasy.client.jaxrs.i18n.Messages;
import org.jboss.resteasy.core.Headers;
import org.jboss.resteasy.core.ProvidersContextRetainer;
import org.jboss.resteasy.core.ResteasyContext;
import org.jboss.resteasy.core.interception.jaxrs.AbstractReaderInterceptorContext;
import org.jboss.resteasy.core.interception.jaxrs.ClientReaderInterceptorContext;
import org.jboss.resteasy.plugins.providers.sse.EventInput;
import org.jboss.resteasy.specimpl.AbstractBuiltResponse;
import org.jboss.resteasy.specimpl.BuiltResponse;
import org.jboss.resteasy.spi.HeaderValueProcessor;
import org.jboss.resteasy.spi.MarshalledEntity;
import org.jboss.resteasy.spi.util.Types;
import org.jboss.resteasy.tracing.RESTEasyTracingLogger;
import org.jboss.resteasy.util.HttpHeaderNames;
import org.jboss.resteasy.util.InputStreamToByteArray;
import org.jboss.resteasy.util.ReadFromStream;
import org.reactivestreams.Publisher;
import javax.ws.rs.ProcessingException;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.ext.Providers;
import javax.ws.rs.ext.ReaderInterceptor;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.lang.annotation.Annotation;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.Map;
/**
* @author Bill Burke
* @version $Revision: 1 $
*/
public abstract class ClientResponse extends BuiltResponse
{
// One thing to note, I don't cache header objects because I was too lazy to proxy the headers multivalued map
protected Map properties;
protected ClientConfiguration configuration;
protected RESTEasyTracingLogger tracingLogger;
@Deprecated
protected ClientResponse(final ClientConfiguration configuration)
{
setClientConfiguration(configuration);
tracingLogger = RESTEasyTracingLogger.empty();
}
protected ClientResponse(final ClientConfiguration configuration, final RESTEasyTracingLogger tracingLogger)
{
setClientConfiguration(configuration);
this.tracingLogger = tracingLogger;
}
@SuppressWarnings({"rawtypes", "unchecked"})
public void setHeaders(MultivaluedMap headers)
{
this.metadata = new Headers