From 1724d9cddbf0e0f4e35f5c5d83bc335994f0286e Mon Sep 17 00:00:00 2001 From: Jesse Wilson Date: Wed, 11 May 2011 14:52:00 -0700 Subject: Support Eviction in DiskLruCache. Change-Id: I84f536e597efb4c2b8dd519261b327dcd3e9eefa http://b/3180373 --- support/src/test/java/libcore/net/http/HttpResponseCache.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'support') diff --git a/support/src/test/java/libcore/net/http/HttpResponseCache.java b/support/src/test/java/libcore/net/http/HttpResponseCache.java index d30b3d9..7476247 100644 --- a/support/src/test/java/libcore/net/http/HttpResponseCache.java +++ b/support/src/test/java/libcore/net/http/HttpResponseCache.java @@ -55,11 +55,13 @@ import libcore.io.Streams; /** * Cache responses in a cache directory. - * - * TODO: tuning knobs, LRU - * TODO: move this class to android.util */ public final class HttpResponseCache extends ResponseCache implements Closeable { + // TODO: tuning knobs + // TODO: better statistics + // TODO: application cache version on disk + // TODO: move this class to android.util + private static final int ENTRY_METADATA = 0; private static final int ENTRY_BODY = 1; private static final int ENTRY_COUNT = 2; @@ -87,7 +89,7 @@ public final class HttpResponseCache extends ResponseCache implements Closeable @Override public synchronized CacheResponse get(URI uri, String requestMethod, Map> requestHeaders) throws IOException { String key = uriToKey(uri); - DiskLruCache.Snapshot snapshot = cache.read(key); + DiskLruCache.Snapshot snapshot = cache.get(key); if (snapshot == null) { missCount++; -- cgit v1.1