to top
Android APIs
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

Manages the HTTP cache used by an application's WebView instances.

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. This method no longer has any effect and 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 cacheResult)
This method is deprecated. Access to the HTTP cache will be removed in a future release.
static boolean startCacheTransaction()
This method is deprecated. This method no longer has any effect and 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.

Gets whether the HTTP cache is disabled.

Returns
  • true if the HTTP cache is disabled

public static boolean endCacheTransaction ()

Since: API Level 1

This method is deprecated.
This method no longer has any effect and always returns false.

Ends the innermost cache transaction and returns whether this was the only running transaction.

Returns
  • true if this was the only running transaction

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.

Gets the cache entry for the specified URL, or null if none is found. If a non-null value is provided for the HTTP headers map, and the cache entry needs validation, appropriate headers will be added to the map. The input stream of the CacheEntry object should be closed by the caller when access to the underlying file is no longer required.

Parameters
url the URL for which a cache entry is requested
headers a map from HTTP header name to value, to be populated for the returned cache entry
Returns
  • the cache entry for the specified 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.

Gets the base directory in which the files used to store the contents of cache entries are placed. See CacheManager.CacheResult.getLocalPath().

Returns
  • the base directory of the cache

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

Since: API Level 1

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

Adds a cache entry to the HTTP cache for the specicifed URL. Also closes the cache entry's output stream.

Parameters
url the URL for which the cache entry should be added
cacheResult the cache entry to add

public static boolean startCacheTransaction ()

Since: API Level 1

This method is deprecated.
This method no longer has any effect and always returns false.

Starts a cache transaction. Returns true if this is the only running transaction. Otherwise, this transaction is nested inside currently running transactions and false is returned.

Returns
  • true if this is the only running transaction