/**
*
*/
package com.azwul.api.model.result;
import java.io.IOException;
import java.io.InputStream;
import org.apache.commons.httpclient.HttpMethod;
import com.azwul.api.exception.AzwulApiException;
import com.azwul.api.model.SessionToken;
/**
* @author Theotime Jurzak
*
*/
public class HttpResult {
protected HttpMethod httpMethod;
protected SessionToken sessionToken;
/**
* @return the sessionToken
*/
public SessionToken getSessionToken() {
return sessionToken;
}
/**
* @param sessionToken
* the sessionToken to set
*/
public void setSessionToken(SessionToken sessionToken) {
this.sessionToken = sessionToken;
}
/**
* @return the httpResponse
*/
public InputStream getHttpResponse() {
try {
return httpMethod.getResponseBodyAsStream();
} catch (IOException e) {
throw new AzwulApiException("Error reading http response stream", e);
}
}
/**
* @return the httpMethod
*/
public HttpMethod getHttpMethod() {
return httpMethod;
}
/**
* @param httpMethod
* the httpMethod to set
*/
public void setHttpMethod(HttpMethod httpMethod) {
this.httpMethod = httpMethod;
}
/**
*
*/
public void releaseConnection() {
httpMethod.releaseConnection();
}
}