public class CacheManager
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.io.File |
cacheDir
Android cache directory
|
static long |
DURATION_NO_CACHE
Don't use caching for this request
|
static long |
DURATION_ONE_DAY |
static long |
DURATION_ONE_HOUR |
static long |
DURATION_ONE_MINUTE |
static long |
DURATION_ONE_MONTH |
static long |
DURATION_ONE_SECOND |
static long |
DURATION_ONE_WEEK |
static long |
DURATION_ONE_YEAR |
Modifier | Constructor and Description |
---|---|
private |
CacheManager() |
Modifier and Type | Method and Description |
---|---|
static void |
cacheRequest(RESTRequest<? extends Resource> request)
Cache request in
cacheDir |
static java.io.File |
getCacheDir()
Getter for
cacheDir |
static java.io.InputStream |
getRequestFromCache(RESTRequest<? extends Resource> r)
Retrieves a
RESTRequest from cache |
static void |
setCacheDir(java.io.File cacheDir)
Setter for
cacheDir |
public static final long DURATION_NO_CACHE
public static final long DURATION_ONE_SECOND
public static final long DURATION_ONE_MINUTE
public static final long DURATION_ONE_HOUR
public static final long DURATION_ONE_DAY
public static final long DURATION_ONE_WEEK
public static final long DURATION_ONE_MONTH
public static final long DURATION_ONE_YEAR
private static java.io.File cacheDir
public static void setCacheDir(java.io.File cacheDir)
cacheDir
cacheDir
- The directory used for cachingpublic static void cacheRequest(RESTRequest<? extends Resource> request) throws java.io.IOException
cacheDir
request
- The request to cachejava.io.IOException
public static java.io.InputStream getRequestFromCache(RESTRequest<? extends Resource> r)
RESTRequest
from cacher
- The RESTRequest
to retrieve