Package com.oceanprotocol.squid.models
Class HttpResponse
- java.lang.Object
-
- com.oceanprotocol.squid.models.HttpResponse
-
public class HttpResponse extends Object
-
-
Field Summary
Fields Modifier and Type Field Description private String
body
private String
charset
private long
contentLength
private org.apache.commons.httpclient.Header[]
headers
private int
statusCode
-
Constructor Summary
Constructors Constructor Description HttpResponse(int statusCode, String body, String charset, long contentLength)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getBody()
Get the bodyString
getCharset()
Get the charsetlong
getContentLength()
Get content lengthorg.apache.commons.httpclient.Header
getHeader(String name)
Get HTTP response header giving a header nameorg.apache.commons.httpclient.Header[]
getHeaders()
Get HTTP response headersint
getStatusCode()
Ge the http status codevoid
setBody(String body)
Set the bodyvoid
setCharset(String charset)
Set the charsetvoid
setContentLength(long contentLength)
Set content lengthvoid
setHeaders(org.apache.commons.httpclient.Header[] headers)
Set HTTP response headersvoid
setStatusCode(int statusCode)
Set the http status codeString
toString()
Get the string representation of the object
-
-
-
Method Detail
-
getStatusCode
public int getStatusCode()
Ge the http status code- Returns:
- status code
-
setStatusCode
public void setStatusCode(int statusCode)
Set the http status code- Parameters:
statusCode
- status code
-
getBody
public String getBody()
Get the body- Returns:
- string body
-
setBody
public void setBody(String body)
Set the body- Parameters:
body
- string
-
getCharset
public String getCharset()
Get the charset- Returns:
- charset
-
setCharset
public void setCharset(String charset)
Set the charset- Parameters:
charset
- charset
-
getContentLength
public long getContentLength()
Get content length- Returns:
- content length
-
setContentLength
public void setContentLength(long contentLength)
Set content length- Parameters:
contentLength
- content length
-
getHeaders
public org.apache.commons.httpclient.Header[] getHeaders()
Get HTTP response headers- Returns:
- headers
-
getHeader
public org.apache.commons.httpclient.Header getHeader(String name)
Get HTTP response header giving a header name- Parameters:
name
- name of the header- Returns:
- header
-
setHeaders
public void setHeaders(org.apache.commons.httpclient.Header[] headers)
Set HTTP response headers- Parameters:
headers
- headers
-
-