public class HttpResponse
extends java.lang.Object
HttpResponse()
HttpResponse(String)
Constructor and Description |
---|
HttpResponse() |
HttpResponse(java.lang.String url) |
HttpResponse(java.lang.String url,
java.lang.String response) |
Modifier and Type | Method and Description |
---|---|
int |
getCacheControlMaxAge()
http cache-control in reponse header
|
long |
getExpiredTime()
get expired time in millis
if current time is bigger than expired time, it means this response is dirty
|
java.lang.String |
getExpiresHeader()
http expires in reponse header
|
long |
getExpiresInMillis()
get expires
|
java.lang.String |
getResponseBody() |
int |
getResponseCode()
get reponse code
|
int |
getType()
get type
type to mark this response, default is 0
it will be used in
HttpCache#HttpCache(android.content.Context, int)
|
java.lang.String |
getUrl() |
boolean |
isExpired()
whether this response has expired
|
boolean |
isInCache()
get isInCache, this is a client mark, whethero is in client cache
|
void |
setExpiredTime(long expiredTime)
set expired time in millis
|
HttpResponse |
setInCache(boolean isInCache)
set isInCache, this is a client mark, whethero is in client cache
|
void |
setResponseBody(java.lang.String responseBody) |
void |
setResponseCode(int responseCode) |
void |
setResponseHeader(java.lang.String field,
java.lang.String newValue)
set response header
|
void |
setResponseHeaders(java.util.Map<java.lang.String,java.lang.Object> responseHeaders) |
void |
setType(int type)
set type
type to mark this response, default is 0, cannot be smaller than 0.
|
void |
setUrl(java.lang.String url) |
public HttpResponse(java.lang.String url)
public HttpResponse(java.lang.String url, java.lang.String response)
public HttpResponse()
public java.lang.String getUrl()
public void setUrl(java.lang.String url)
public java.lang.String getResponseBody()
public void setResponseBody(java.lang.String responseBody)
public int getResponseCode()
int
representing the three digit HTTP Status-Code.
public void setResponseCode(int responseCode)
public void setResponseHeaders(java.util.Map<java.lang.String,java.lang.Object> responseHeaders)
public int getType()
HttpCache#HttpCache(android.content.Context, int)
public void setType(int type)
HttpCache#HttpCache(android.content.Context, int)
type
- the type to setpublic void setExpiredTime(long expiredTime)
expiredTime
- public long getExpiredTime()
public boolean isExpired()
public boolean isInCache()
public HttpResponse setInCache(boolean isInCache)
isInCache
- the isInCache to setpublic java.lang.String getExpiresHeader()
public int getCacheControlMaxAge()
public long getExpiresInMillis()
public void setResponseHeader(java.lang.String field, java.lang.String newValue)
field
- newValue
-