当前位置: 首页>>代码示例>>Java>>正文


Java ResponseCache.getDefault方法代码示例

本文整理汇总了Java中java.net.ResponseCache.getDefault方法的典型用法代码示例。如果您正苦于以下问题:Java ResponseCache.getDefault方法的具体用法?Java ResponseCache.getDefault怎么用?Java ResponseCache.getDefault使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.net.ResponseCache的用法示例。


在下文中一共展示了ResponseCache.getDefault方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: copyWithDefaults

import java.net.ResponseCache; //导入方法依赖的package包/类
/**
 * Returns a shallow copy of this OkHttpClient that uses the system-wide default for
 * each field that hasn't been explicitly configured.
 */
private OkHttpClient copyWithDefaults() {
  OkHttpClient result = new OkHttpClient(this);
  result.proxy = proxy;
  result.proxySelector = proxySelector != null ? proxySelector : ProxySelector.getDefault();
  result.cookieHandler = cookieHandler != null ? cookieHandler : CookieHandler.getDefault();
  result.responseCache = responseCache != null ? responseCache : ResponseCache.getDefault();
  result.sslSocketFactory = sslSocketFactory != null
      ? sslSocketFactory
      : HttpsURLConnection.getDefaultSSLSocketFactory();
  result.hostnameVerifier = hostnameVerifier != null
      ? hostnameVerifier
      : OkHostnameVerifier.INSTANCE;
  result.authenticator = authenticator != null
      ? authenticator
      : HttpAuthenticator.SYSTEM_DEFAULT;
  result.connectionPool = connectionPool != null ? connectionPool : ConnectionPool.getDefault();
  result.followProtocolRedirects = followProtocolRedirects;
  result.transports = transports != null ? transports : DEFAULT_TRANSPORTS;
  result.connectTimeout = connectTimeout;
  result.readTimeout = readTimeout;
  return result;
}
 
开发者ID:aabognah,项目名称:LoRaWAN-Smart-Parking,代码行数:27,代码来源:OkHttpClient.java

示例2: getInstalled

import java.net.ResponseCache; //导入方法依赖的package包/类
/**
 * Returns the currently-installed {@code HttpResponseCache}, or null if there is no cache
 * installed or it is not a {@code HttpResponseCache}.
 */
public static HttpResponseCache getInstalled() {
  ResponseCache installed = ResponseCache.getDefault();
  if (installed instanceof HttpResponseCache) {
    return (HttpResponseCache) installed;
  }
  return null;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:12,代码来源:HttpResponseCache.java

示例3: close

import java.net.ResponseCache; //导入方法依赖的package包/类
/**
 * Uninstalls the cache and releases any active resources. Stored contents will remain on the
 * filesystem.
 */
@Override public void close() throws IOException {
  if (ResponseCache.getDefault() == this) {
    ResponseCache.setDefault(null);
  }
  shimResponseCache.close();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:11,代码来源:HttpResponseCache.java

示例4: delete

import java.net.ResponseCache; //导入方法依赖的package包/类
/**
 * Uninstalls the cache and deletes all of its stored contents.
 */
public void delete() throws IOException {
  if (ResponseCache.getDefault() == this) {
    ResponseCache.setDefault(null);
  }
  shimResponseCache.delete();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:10,代码来源:HttpResponseCache.java

示例5: openUrl

import java.net.ResponseCache; //导入方法依赖的package包/类
private URLConnection openUrl(HttpUrl url) {
  ResponseCache responseCache = ResponseCache.getDefault();
  AndroidInternal.setResponseCache(urlFactory, responseCache);
  return urlFactory.open(url.url());
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:6,代码来源:HttpResponseCacheTest.java

示例6: run

import java.net.ResponseCache; //导入方法依赖的package包/类
public ResponseCache run() {
    return ResponseCache.getDefault();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:4,代码来源:HttpURLConnection.java


注:本文中的java.net.ResponseCache.getDefault方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。