android.webkit
public
final
class
android.webkit.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 Classes
Summary
Public Constructors
Public Methods
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
Details
Public Constructors
Public Methods
public
static
boolean
cacheDisabled()
get the state of the current cache, enabled or disabled
public
static
boolean
cacheEmpty()
Return true if the cache is empty.
Given a url, returns the CacheResult if exists. Otherwise returns null.
If headers are provided and a cache needs validation,
HEADER_KEY_IFNONEMATCH or HEADER_KEY_IFMODIFIEDSINCE will be set in the
cached headers.
Returns
- the CacheResult for a given url
public
static
File
getCacheFileBaseDir()
get the base directory of the cache. With localPath of the CacheResult,
it identifies the cache file.
Returns
- File The base directory of the cache.
public
static
boolean
removeAllCacheFiles()
Save the info of a cache file for a given url to the CacheMap so that it
can be reused later
public
static
void
setCacheDisabled(boolean disabled)
set the flag to control whether cache is enabled or disabled
Parameters
disabled
| true to disable the cache
|
public
static
void
trimCacheIfNeeded()