From 495b5f78a072b7812fe06f0b4c6565d5036f0587 Mon Sep 17 00:00:00 2001 From: John Carlson Date: Wed, 7 Nov 2018 05:01:01 -0600 Subject: [PATCH] Add some docs for Cache class (#4375) * Add some docs for cache * Correction to size getter * Update based on feedback --- okhttp/src/main/java/okhttp3/Cache.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/okhttp/src/main/java/okhttp3/Cache.java b/okhttp/src/main/java/okhttp3/Cache.java index d43d91d25732..343df45113a1 100644 --- a/okhttp/src/main/java/okhttp3/Cache.java +++ b/okhttp/src/main/java/okhttp3/Cache.java @@ -175,6 +175,9 @@ public final class Cache implements Closeable, Flushable { private int hitCount; private int requestCount; + /** + * Create a cache of at most {@code maxSize} bytes in {@code directory}. + */ public Cache(File directory, long maxSize) { this(directory, maxSize, FileSystem.SYSTEM); } @@ -379,6 +382,7 @@ public long size() throws IOException { return cache.size(); } + /** Max size of the cache (in bytes). */ public long maxSize() { return cache.getMaxSize(); }