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

java.com.ionic.sdk.httpclient.HttpResponse Maven / Gradle / Ivy

Go to download

The Ionic Java SDK provides an easy-to-use interface to the Ionic Platform.

There is a newer version: 2.9.0
Show newest version
package com.ionic.sdk.httpclient;

import java.io.ByteArrayInputStream;

/**
 * Encapsulate the server response to a client HTTP request.
 */
public class HttpResponse {
    /**
     * The HTTP status code associated with the response.
     */
    private final int statusCode;

    /**
     * The HTTP headers associated with the response.
     */
    private final HttpHeaders httpHeaders;

    /**
     * The entity bytes associated with the response.
     */
    private final ByteArrayInputStream entity;

    /**
     * Constructor, complete specifying the data associated with the response.
     *
     * @param statusCodeIn  the HTTP response status code
     * @param httpHeadersIn the HTTP headers
     * @param entityIn      the HTTP response entity
     */
    public HttpResponse(final int statusCodeIn, final HttpHeaders httpHeadersIn, final ByteArrayInputStream entityIn) {
        this.statusCode = statusCodeIn;
        this.httpHeaders = httpHeadersIn;
        this.entity = entityIn;
    }

    /**
     * @return the HTTP status code associated with the response.
     */
    public final int getStatusCode() {
        return statusCode;
    }

    /**
     * @return the HTTP headers associated with the response.
     */
    public final HttpHeaders getHttpHeaders() {
        return httpHeaders;
    }

    /**
     * @return the entity bytes associated with the response.
     */
    public final ByteArrayInputStream getEntity() {
        return entity;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy