All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.fitbur.github.dockerjava.jaxrs.connector.ApacheConnectorClientResponse Maven / Gradle / Ivy

There is a newer version: 1.0.0
Show newest version
package com.fitbur.github.dockerjava.jaxrs.connector;

import java.io.IOException;

import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.StatusType;

import com.fitbur.apache.http.client.methods.CloseableHttpResponse;
import com.fitbur.glassfish.com.fitbur.client.ClientRequest;
import com.fitbur.glassfish.com.fitbur.client.ClientResponse;

/**
 * Fix for https://github.com.fitbur/docker-java/docker-java/issues/196
 * 
 * https://java.net/jira/browse/JERSEY-2852
 * 
 * @author marcus
 *
 */
public class ApacheConnectorClientResponse extends ClientResponse {

    private CloseableHttpResponse closeableHttpResponse;

    public ApacheConnectorClientResponse(ClientRequest requestContext, Response response) {
        super(requestContext, response);
    }

    public ApacheConnectorClientResponse(StatusType status, ClientRequest requestContext,
            CloseableHttpResponse closeableHttpResponse) {
        super(status, requestContext);
        this.closeableHttpResponse = closeableHttpResponse;
    }

    public ApacheConnectorClientResponse(StatusType status, ClientRequest requestContext) {
        super(status, requestContext);
    }

    @Override
    public void close() {
        try {
            closeableHttpResponse.close();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        super.close();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy