public class AndroidShimResponseCache extends ResponseCache
ResponseCache
with stats.| Modifier and Type | Method and Description |
|---|---|
void |
close()
Uninstalls the cache and releases any active resources.
|
static AndroidShimResponseCache |
create(File directory,
long maxSize) |
void |
delete()
Uninstalls the cache and deletes all of its stored contents.
|
void |
flush()
Force buffered operations to the filesystem.
|
CacheResponse |
get(URI uri,
String requestMethod,
Map<String,List<String>> requestHeaders) |
Cache |
getCache() |
int |
getHitCount()
Returns the number of HTTP requests whose response was provided by the cache.
|
int |
getNetworkCount()
Returns the number of HTTP requests that required the network to either supply a response or
validate a locally cached response.
|
int |
getRequestCount()
Returns the total number of HTTP requests that were made.
|
boolean |
isEquivalent(File directory,
long maxSize) |
long |
maxSize()
Returns the maximum number of bytes that this cache should use to store its data.
|
CacheRequest |
put(URI uri,
URLConnection urlConnection) |
long |
size()
Returns the number of bytes currently being used to store the values in this cache.
|
getDefault, setDefaultpublic static AndroidShimResponseCache create(File directory, long maxSize) throws IOException
IOExceptionpublic boolean isEquivalent(File directory, long maxSize)
public Cache getCache()
public CacheResponse get(URI uri, String requestMethod, Map<String,List<String>> requestHeaders) throws IOException
get in class ResponseCacheIOExceptionpublic CacheRequest put(URI uri, URLConnection urlConnection) throws IOException
put in class ResponseCacheIOExceptionpublic long size()
throws IOException
maxSize() if a background deletion is pending.IOExceptionpublic long maxSize()
public void flush()
throws IOException
IOExceptionpublic int getNetworkCount()
public int getHitCount()
GET requests that were validated over the network.public int getRequestCount()
public void close()
throws IOException
IOExceptionpublic void delete()
throws IOException
IOExceptionCopyright © 2017. All Rights Reserved.