OkHttpEngine: improve cache API, add example #138

This commit is contained in:
Emux
2017-06-07 21:24:18 +03:00
parent 903dbad9c6
commit 3f959a3b46
3 changed files with 22 additions and 6 deletions

View File

@@ -55,11 +55,11 @@ public class OkHttpEngine implements HttpEngine {
}
/**
* OkHttp cache implemented through {@link OkHttpClient.Builder#cache(Cache)}.
* Sets the response cache to be used to read and write cached responses.
*/
public OkHttpFactory(Cache cache) {
mClientBuilder = new OkHttpClient.Builder()
.cache(cache);
public OkHttpFactory cache(Cache cache) {
mClientBuilder.cache(cache);
return this;
}
/**