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

com.hc360.hcpay.payment.util.httpClient.HttpResponse Maven / Gradle / Ivy

The newest version!
package com.hc360.hcpay.payment.util.httpClient;

import java.io.UnsupportedEncodingException;

import org.apache.commons.httpclient.Header;

import com.hc360.hcpay.payment.config.HCPayConfig;

/* *
 *??????HttpResponse
 *???ܣ?Http???ض???ķ?װ
 *??ϸ????װHttp??????Ϣ
 *?汾??3.3
 *???ڣ?2011-08-17
 *˵????
 *???´???ֻ??Ϊ?˷????̻????Զ??ṩ?????????룬?̻????Ը????Լ???վ????Ҫ?????ռ????ĵ???д,????һ??Ҫʹ?øô??롣
 *?ô??????ѧϰ???о??۸????ӿ?ʹ?ã?ֻ???ṩһ???ο???
 */

public class HttpResponse {

    /**
     * ?????е?Header??Ϣ
     */
    private Header[] responseHeaders;

    /**
     * String???͵?result
     */
    private String   stringResult;

    /**
     * btye???͵?result
     */
    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, HCPayConfig.input_charset);
        }
        return null;
    }

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

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy