|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectandroid.webkit.CacheManager
public final class CacheManager
The class CacheManager provides the persistent cache of content that is received over the network. The component handles parsing of HTTP headers and utilizes the relevant cache headers to determine if the content should be stored and if so, how long it is valid for. Network requests are provided to this component and if they can not be resolved by the cache, the HTTP headers are attached, as appropriate, to the request for revalidation of content. The class also manages the cache size.
| Nested Class Summary | |
|---|---|
static class |
CacheManager.CacheResult
|
| Field Summary | |
|---|---|
(package private) static String |
HEADER_KEY_IFMODIFIEDSINCE
|
(package private) static String |
HEADER_KEY_IFNONEMATCH
|
| Constructor Summary | |
|---|---|
CacheManager()
|
|
| Method Summary | |
|---|---|
static boolean |
cacheDisabled()
get the state of the current cache, enabled or disabled |
(package private) static boolean |
cacheEmpty()
Return true if the cache is empty. |
static CacheManager.CacheResult |
createCacheFile(String url,
int statusCode,
Headers headers,
String mimeType,
boolean forceCache)
Given a url and its full headers, returns CacheResult if a local cache can be stored. |
(package private) static boolean |
disableTransaction()
|
(package private) static boolean |
enableTransaction()
|
static boolean |
endCacheTransaction()
|
static CacheManager.CacheResult |
getCacheFile(String url,
Map<String,String> headers)
Given a url, returns the CacheResult if exists. |
static File |
getCacheFileBaseDir()
get the base directory of the cache. |
(package private) static void |
init(Context context)
initialize the CacheManager. |
(package private) static boolean |
removeAllCacheFiles()
remove all cache files |
static void |
saveCacheFile(String url,
CacheManager.CacheResult cacheRet)
Save the info of a cache file for a given url to the CacheMap so that it can be reused later |
(package private) static void |
setCacheDisabled(boolean disabled)
set the flag to control whether cache is enabled or disabled |
static boolean |
startCacheTransaction()
|
(package private) static void |
trimCacheIfNeeded()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
static final String HEADER_KEY_IFMODIFIEDSINCE
static final String HEADER_KEY_IFNONEMATCH
| Constructor Detail |
|---|
public CacheManager()
| Method Detail |
|---|
static void init(Context context)
context - The application context.public static File getCacheFileBaseDir()
static void setCacheDisabled(boolean disabled)
disabled - true to disable the cachepublic static boolean cacheDisabled()
static boolean enableTransaction()
static boolean disableTransaction()
public static boolean startCacheTransaction()
public static boolean endCacheTransaction()
public static CacheManager.CacheResult getCacheFile(String url,
Map<String,String> headers)
public static CacheManager.CacheResult createCacheFile(String url,
int statusCode,
Headers headers,
String mimeType,
boolean forceCache)
public static void saveCacheFile(String url,
CacheManager.CacheResult cacheRet)
static boolean removeAllCacheFiles()
static boolean cacheEmpty()
static void trimCacheIfNeeded()
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||