Class ShadowHttpResponseCache
java.lang.Object
org.robolectric.shadows.ShadowHttpResponseCache
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidclose()protected voiddelete()protected voidflush()protected CacheResponseprotected intprotected static HttpResponseCacheprotected intprotected intprotected static HttpResponseCacheInstalls the cache the way the framework does, by making it the defaultResponseCache.protected longmaxSize()protected CacheRequestput(URI uri, URLConnection urlConnection) static voidreset()The defaultResponseCacheis process-wide state that outlives the sandbox, so a cache a test installs has to be uninstalled again.protected longsize()
-
Constructor Details
-
ShadowHttpResponseCache
public ShadowHttpResponseCache()
-
-
Method Details
-
install
Installs the cache the way the framework does, by making it the defaultResponseCache.Keeping it anywhere else would leave
ResponseCache.getDefault()empty, which callers reach through the inheritedHttpResponseCache.getDefault(). -
getInstalled
-
maxSize
-
size
-
close
-
delete
-
getHitCount
-
getNetworkCount
-
getRequestCount
-
get
@Implementation protected CacheResponse get(URI uri, String requestMethod, Map<String, List<String>> requestHeaders) -
put
-
flush
-
reset
The defaultResponseCacheis process-wide state that outlives the sandbox, so a cache a test installs has to be uninstalled again. Anything else installed there is left alone.
-