public final class

CacheManager

extends Object
java.lang.Object
   ↳ android.webkit.CacheManager

This class is deprecated.
Access to the HTTP cache will be removed in a future release.

Class Overview

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.

Summary

Nested Classes
class CacheManager.CacheResult This class is deprecated. Access to the HTTP cache will be removed in a future release.  
Public Constructors
CacheManager()
Public Methods
static boolean cacheDisabled()
This method is deprecated. Access to the HTTP cache will be removed in a future release.
static boolean endCacheTransaction()
This method is deprecated. Always returns false.
static CacheManager.CacheResult getCacheFile(String url, Map<StringString> headers)
This method is deprecated. Access to the HTTP cache will be removed in a future release.
static File getCacheFileBaseDir()
This method is deprecated. Access to the HTTP cache will be removed in a future release.
static void saveCacheFile(String url, CacheManager.CacheResult cacheRet)
This method is deprecated. Access to the HTTP cache will be removed in a future release.
static boolean startCacheTransaction()
This method is deprecated. Always returns false.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public CacheManager ()

Since: API Level 1

Public Methods

public static boolean cacheDisabled ()

Since: API Level 1

This method is deprecated.
Access to the HTTP cache will be removed in a future release.

Whether the cache is disabled.

Returns
  • return Whether the cache is disabled

public static boolean endCacheTransaction ()

Since: API Level 1

This method is deprecated.
Always returns false.

public static CacheManager.CacheResult getCacheFile (String url, Map<StringString> headers)

Since: API Level 1

This method is deprecated.
Access to the HTTP cache will be removed in a future release.

Given a URL, returns the corresponding CacheResult if it exists, or null otherwise. The input stream of the CacheEntry object is initialized and opened and should be closed by the caller when access to the underlying file is no longer required. If a non-zero value is provided for the headers map, and the cache entry needs validation, HEADER_KEY_IFNONEMATCH or HEADER_KEY_IFMODIFIEDSINCE will be set in headers.

Returns
  • The CacheResult for the given URL

public static File getCacheFileBaseDir ()

Since: API Level 1

This method is deprecated.
Access to the HTTP cache will be removed in a future release.

Get the base directory of the cache. Together with the local path of the CacheResult, obtained from getLocalPath(), this identifies the cache file. Cache files are not guaranteed to be in this directory before CacheManager#getCacheFile(String, Map) is called.

Returns
  • File The base directory of the cache.

public static void saveCacheFile (String url, CacheManager.CacheResult cacheRet)

Since: API Level 1

This method is deprecated.
Access to the HTTP cache will be removed in a future release.

Save the info of a cache file for a given url to the CacheMap so that it can be reused later

public static boolean startCacheTransaction ()

Since: API Level 1

This method is deprecated.
Always returns false.