Example usage for com.squareup.okhttp Cache delete

List of usage examples for com.squareup.okhttp Cache delete

Introduction

In this page you can find the example usage for com.squareup.okhttp Cache delete.

Prototype

public void delete() throws IOException 

Source Link

Document

Closes the cache and deletes all of its stored values.

Usage

From source file:de.dev.eth0.rssreader.app.http.HttpLoaderImpl.java

License:Apache License

/**
 * Call this to reset the cache-size/*  www  .  j  a  v a  2 s  . co m*/
 *
 * @param context
 */
public static void updateCacheSize(Context context) {
    try {
        HttpLoaderImpl fl = getInstance(context);
        Cache cache = fl.client.getCache();
        if (cache != null) {
            cache.flush();
            cache.close();
            cache.delete();
        }
        fl.client.setCache(getCache(context));
    } catch (IOException ex) {
        Timber.w(ex, "Could not update Cachesize");
    }
}