Example usage for java.net ResponseCache getDefault

List of usage examples for java.net ResponseCache getDefault

Introduction

In this page you can find the example usage for java.net ResponseCache getDefault.

Prototype

public static synchronized ResponseCache getDefault() 

Source Link

Document

Gets the system-wide response cache.

Usage

From source file:android.net.http.HttpResponseCache.java

/**
 * Returns the currently-installed {@code HttpResponseCache}, or null if
 * there is no cache installed or it is not a {@code HttpResponseCache}.
 *///from www .ja  va2s . c om
public static HttpResponseCache getInstalled() {
    ResponseCache installed = ResponseCache.getDefault();
    return installed instanceof HttpResponseCache ? (HttpResponseCache) installed : null;
}

From source file:android.net.http.HttpResponseCache.java

/**
 * Uninstalls the cache and releases any active resources. Stored contents
 * will remain on the filesystem.//from w w  w .ja va2 s  . co  m
 */
@Override
public void close() throws IOException {
    if (ResponseCache.getDefault() == this) {
        ResponseCache.setDefault(null);
    }
    delegate.getCache().close();
}

From source file:android.net.http.HttpResponseCache.java

/**
 * Uninstalls the cache and deletes all of its stored contents.
 *//*from  w w w  .j  a v a  2 s.co  m*/
public void delete() throws IOException {
    if (ResponseCache.getDefault() == this) {
        ResponseCache.setDefault(null);
    }
    delegate.getCache().delete();
}