Skip to content

Commit

Permalink
Add some docs for Cache class (#4375)
Browse files Browse the repository at this point in the history
* Add some docs for cache

* Correction to size getter

* Update based on feedback
  • Loading branch information
Jawnnypoo authored and swankjesse committed Nov 7, 2018
1 parent 1b4ab8a commit 495b5f7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions okhttp/src/main/java/okhttp3/Cache.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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();
}
Expand Down

0 comments on commit 495b5f7

Please sign in to comment.