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, setDefault
public static AndroidShimResponseCache create(File directory, long maxSize) throws IOException
IOException
public 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 ResponseCache
IOException
@Nullable public CacheRequest put(URI uri, URLConnection urlConnection) throws IOException
put
in class ResponseCache
IOException
public long size() throws IOException
maxSize()
if a background deletion is pending.IOException
public long maxSize()
public void flush() throws IOException
IOException
public int getNetworkCount()
public int getHitCount()
GET
requests that were validated over the network.public int getRequestCount()
public void close() throws IOException
IOException
public void delete() throws IOException
IOException
Copyright © 2019. All rights reserved.