Example usage for com.squareup.okhttp Cache flush

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

Introduction

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

Prototype

public void flush() throws IOException 

Source Link

Usage

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

License:Apache License

/**
 * Call this to reset the cache-size//from  www .  jav a2 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");
    }
}