public class HttpCache
extends java.lang.Object
ImageCacheHttpCache(Context) to init cachehttpGet(HttpRequest, HttpCacheListener)httpGet(String, HttpCacheListener)httpGet(HttpRequest)httpGet(String)httpGetString(HttpRequest)httpGetString(String)| Modifier and Type | Class and Description |
|---|---|
static class |
HttpCache.HttpCacheListener
HttpCacheListener, can do something before or after HttpGet
|
| Constructor and Description |
|---|
HttpCache(Context context) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Removes all elements from this cache, leaving it empty.
|
boolean |
containsKey(java.lang.String url)
whether this cache contains the specified url.
|
HttpResponse |
httpGet(HttpRequest request)
http get
Attentions:
Don't call this on the ui thread, it may costs some times.
|
void |
httpGet(HttpRequest request,
HttpCache.HttpCacheListener listener)
http get
It gets data from cache or network asynchronous.
|
HttpResponse |
httpGet(java.lang.String url)
http get
Attentions:
Don't call this on the ui thread, it may costs some times.
|
void |
httpGet(java.lang.String url,
HttpCache.HttpCacheListener listener)
http get
It gets data from cache or network asynchronous.
|
HttpResponse |
httpGetString(HttpRequest httpRequest)
http get
Attentions:
Don't call this on the ui thread, it may costs some times.
|
java.lang.String |
httpGetString(java.lang.String url)
http get
Attentions:
Don't call this on the ui thread, it may costs some times.
|
public HttpResponse httpGet(HttpRequest request)
httpGet(HttpRequest, HttpCacheListener)httpRequest - public void httpGet(java.lang.String url,
HttpCache.HttpCacheListener listener)
httpGet(HttpRequest) or
httpGetString(HttpRequest)url - listener - listener which can do something before or after HttpGet. this can be null if you not want to do
somethingpublic void httpGet(HttpRequest request, HttpCache.HttpCacheListener listener)
httpGet(HttpRequest) or
httpGetString(HttpRequest)request - listener - listener which can do something before or after HttpGet. this can be null if you not want to do
somethingpublic HttpResponse httpGet(java.lang.String url)
httpGet(HttpRequest, HttpCacheListener)url - public java.lang.String httpGetString(java.lang.String url)
httpGet(String, HttpCacheListener)url - public HttpResponse httpGetString(HttpRequest httpRequest)
httpGet(HttpRequest, HttpCacheListener)httpRequest - public boolean containsKey(java.lang.String url)
url - public void clear()