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

com.sc.utils.rest.httpClient.HttpResponse Maven / Gradle / Ivy

package com.sc.utils.rest.httpClient;

import org.apache.commons.httpclient.Header;

import java.io.UnsupportedEncodingException;


public class HttpResponse {

    
    private Header[] responseHeaders;

    
    private String stringResult;

    
    private byte[]   byteResult;

    public Header[] getResponseHeaders() {
        return responseHeaders;
    }

    public void setResponseHeaders(Header[] responseHeaders) {
        this.responseHeaders = responseHeaders;
    }

    public byte[] getByteResult() {
        if (byteResult != null) {
            return byteResult;
        }
        if (stringResult != null) {
            return stringResult.getBytes();
        }
        return null;
    }

    public void setByteResult(byte[] byteResult) {
        this.byteResult = byteResult;
    }

    public String getStringResult() throws UnsupportedEncodingException {
        if (stringResult != null) {
            return stringResult;
        }
        if (byteResult != null) {
            return new String(byteResult, "utf-8");
        }
        return null;
    }

    public void setStringResult(String stringResult) {
        this.stringResult = stringResult;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy