Search in sources :

Example 1 with HttpResponseCache

use of com.android.okhttp.HttpResponseCache in project robovm by robovm.

the class URLConnectionTest method initResponseCache.

private void initResponseCache() throws IOException {
    String tmp = System.getProperty("java.io.tmpdir");
    File cacheDir = new File(tmp, "HttpCache-" + UUID.randomUUID());
    cache = new HttpResponseCache(cacheDir, Integer.MAX_VALUE);
    ResponseCache.setDefault(cache);
}
Also used : HttpResponseCache(com.android.okhttp.HttpResponseCache) File(java.io.File)

Aggregations

HttpResponseCache (com.android.okhttp.HttpResponseCache)1 File (java.io.File)1