Java 类java.net.ResponseCache 实例源码

项目:LoRaWAN-Smart-Parking    文件:OkHttpClient.java   
/**
 * 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;
}
项目:LoRaWAN-Smart-Parking    文件:OkHttpClient.java   
/**
 * 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;
}
项目:GitHub    文件:CacheAdapterTest.java   
@Test public void get_httpGet() throws Exception {
  final URL serverUrl = configureServer(new MockResponse());
  assertEquals("http", serverUrl.getProtocol());

  ResponseCache responseCache = new AbstractResponseCache() {
    @Override public CacheResponse get(
        URI uri, String method, Map<String, List<String>> headers) throws IOException {
      try {
        assertEquals(toUri(serverUrl), uri);
        assertEquals("GET", method);
        assertTrue("Arbitrary standard header not present", headers.containsKey("User-Agent"));
        assertEquals(Collections.singletonList("value1"), headers.get("key1"));
        return null;
      } catch (Throwable t) {
        throw new IOException("unexpected cache failure", t);
      }
    }
  };
  setInternalCache(new CacheAdapter(responseCache));

  connection = new OkUrlFactory(client).open(serverUrl);
  connection.setRequestProperty("key1", "value1");

  executeGet(connection);
}
项目:GitHub    文件:ResponseCacheTest.java   
@Test public void otherStacks_cacheHitWithoutVary() throws Exception {
  server.enqueue(new MockResponse()
      .addHeader("Cache-Control: max-age=60")
      .setBody("A"));
  server.enqueue(new MockResponse()
      .setBody("FAIL"));

  // Set the cache as the shared cache.
  ResponseCache.setDefault(cache);

  // Use the platform's HTTP stack.
  URLConnection connection = server.url("/").url().openConnection();
  assertFalse(connection instanceof OkHttpURLConnection);
  assertEquals("A", readAscii(connection));

  URLConnection connection2 = server.url("/").url().openConnection();
  assertFalse(connection2 instanceof OkHttpURLConnection);
  assertEquals("A", readAscii(connection2));
}
项目:GitHub    文件:ResponseCacheTest.java   
@Test public void otherStacks_cacheMissWithVaryAcceptEncoding() throws Exception {
  server.enqueue(new MockResponse()
      .addHeader("Cache-Control: max-age=60")
      .addHeader("Vary: Accept-Encoding")
      .setBody("A"));
  server.enqueue(new MockResponse()
      .setBody("B"));

  // Set the cache as the shared cache.
  ResponseCache.setDefault(cache);

  // Use the platform's HTTP stack.
  URLConnection connection = server.url("/").url().openConnection();
  assertFalse(connection instanceof OkHttpURLConnection);
  assertEquals("A", readAscii(connection));

  URLConnection connection2 = server.url("/").url().openConnection();
  assertFalse(connection2 instanceof OkHttpURLConnection);
  assertEquals("B", readAscii(connection2));
}
项目:GitHub    文件:ResponseCacheTest.java   
@Test public void otherStacks_cacheMissWithVary() throws Exception {
  server.enqueue(new MockResponse()
      .addHeader("Cache-Control: max-age=60")
      .addHeader("Vary: Accept-Language")
      .setBody("A"));
  server.enqueue(new MockResponse()
      .setBody("B"));

  // Set the cache as the shared cache.
  ResponseCache.setDefault(cache);

  // Use the platform's HTTP stack.
  URLConnection connection = server.url("/").url().openConnection();
  assertFalse(connection instanceof OkHttpURLConnection);
  connection.setRequestProperty("Accept-Language", "en-US");
  assertEquals("A", readAscii(connection));

  URLConnection connection2 = server.url("/").url().openConnection();
  assertFalse(connection2 instanceof OkHttpURLConnection);
  assertEquals("B", readAscii(connection2));
}
项目:GitHub    文件:ResponseCacheTest.java   
@Test public void otherStacks_cacheMissWithVaryAsterisk() throws Exception {
  server.enqueue(new MockResponse()
      .addHeader("Cache-Control: max-age=60")
      .addHeader("Vary: *")
      .setBody("A"));
  server.enqueue(new MockResponse()
      .setBody("B"));

  // Set the cache as the shared cache.
  ResponseCache.setDefault(cache);

  // Use the platform's HTTP stack.
  URLConnection connection = server.url("/").url().openConnection();
  assertFalse(connection instanceof OkHttpURLConnection);
  assertEquals("A", readAscii(connection));

  URLConnection connection2 = server.url("/").url().openConnection();
  assertFalse(connection2 instanceof OkHttpURLConnection);
  assertEquals("B", readAscii(connection2));
}
项目:GitHub    文件:CacheAdapterTest.java   
@Test public void get_httpGet() throws Exception {
  final URL serverUrl = configureServer(new MockResponse());
  assertEquals("http", serverUrl.getProtocol());

  ResponseCache responseCache = new AbstractResponseCache() {
    @Override public CacheResponse get(
        URI uri, String method, Map<String, List<String>> headers) throws IOException {
      try {
        assertEquals(toUri(serverUrl), uri);
        assertEquals("GET", method);
        assertTrue("Arbitrary standard header not present", headers.containsKey("User-Agent"));
        assertEquals(Collections.singletonList("value1"), headers.get("key1"));
        return null;
      } catch (Throwable t) {
        throw new IOException("unexpected cache failure", t);
      }
    }
  };
  setInternalCache(new CacheAdapter(responseCache));

  connection = new OkUrlFactory(client).open(serverUrl);
  connection.setRequestProperty("key1", "value1");

  executeGet(connection);
}
项目:GitHub    文件:ResponseCacheTest.java   
@Test public void otherStacks_cacheHitWithoutVary() throws Exception {
  server.enqueue(new MockResponse()
      .addHeader("Cache-Control: max-age=60")
      .setBody("A"));
  server.enqueue(new MockResponse()
      .setBody("FAIL"));

  // Set the cache as the shared cache.
  ResponseCache.setDefault(cache);

  // Use the platform's HTTP stack.
  URLConnection connection = server.url("/").url().openConnection();
  assertFalse(connection instanceof OkHttpURLConnection);
  assertEquals("A", readAscii(connection));

  URLConnection connection2 = server.url("/").url().openConnection();
  assertFalse(connection2 instanceof OkHttpURLConnection);
  assertEquals("A", readAscii(connection2));
}
项目:GitHub    文件:ResponseCacheTest.java   
@Test public void otherStacks_cacheMissWithVaryAcceptEncoding() throws Exception {
  server.enqueue(new MockResponse()
      .addHeader("Cache-Control: max-age=60")
      .addHeader("Vary: Accept-Encoding")
      .setBody("A"));
  server.enqueue(new MockResponse()
      .setBody("B"));

  // Set the cache as the shared cache.
  ResponseCache.setDefault(cache);

  // Use the platform's HTTP stack.
  URLConnection connection = server.url("/").url().openConnection();
  assertFalse(connection instanceof OkHttpURLConnection);
  assertEquals("A", readAscii(connection));

  URLConnection connection2 = server.url("/").url().openConnection();
  assertFalse(connection2 instanceof OkHttpURLConnection);
  assertEquals("B", readAscii(connection2));
}
项目:GitHub    文件:ResponseCacheTest.java   
@Test public void otherStacks_cacheMissWithVary() throws Exception {
  server.enqueue(new MockResponse()
      .addHeader("Cache-Control: max-age=60")
      .addHeader("Vary: Accept-Language")
      .setBody("A"));
  server.enqueue(new MockResponse()
      .setBody("B"));

  // Set the cache as the shared cache.
  ResponseCache.setDefault(cache);

  // Use the platform's HTTP stack.
  URLConnection connection = server.url("/").url().openConnection();
  assertFalse(connection instanceof OkHttpURLConnection);
  connection.setRequestProperty("Accept-Language", "en-US");
  assertEquals("A", readAscii(connection));

  URLConnection connection2 = server.url("/").url().openConnection();
  assertFalse(connection2 instanceof OkHttpURLConnection);
  assertEquals("B", readAscii(connection2));
}
项目:GitHub    文件:ResponseCacheTest.java   
@Test public void otherStacks_cacheMissWithVaryAsterisk() throws Exception {
  server.enqueue(new MockResponse()
      .addHeader("Cache-Control: max-age=60")
      .addHeader("Vary: *")
      .setBody("A"));
  server.enqueue(new MockResponse()
      .setBody("B"));

  // Set the cache as the shared cache.
  ResponseCache.setDefault(cache);

  // Use the platform's HTTP stack.
  URLConnection connection = server.url("/").url().openConnection();
  assertFalse(connection instanceof OkHttpURLConnection);
  assertEquals("A", readAscii(connection));

  URLConnection connection2 = server.url("/").url().openConnection();
  assertFalse(connection2 instanceof OkHttpURLConnection);
  assertEquals("B", readAscii(connection2));
}
项目:PriorityOkHttp    文件:CacheAdapterTest.java   
@Test public void get_httpGet() throws Exception {
  final URL serverUrl = configureServer(new MockResponse());
  assertEquals("http", serverUrl.getProtocol());

  ResponseCache responseCache = new AbstractResponseCache() {
    @Override public CacheResponse get(
        URI uri, String method, Map<String, List<String>> headers) throws IOException {
      assertEquals(toUri(serverUrl), uri);
      assertEquals("GET", method);
      assertTrue("Arbitrary standard header not present", headers.containsKey("User-Agent"));
      assertEquals(Collections.singletonList("value1"), headers.get("key1"));
      return null;
    }
  };
  setInternalCache(new CacheAdapter(responseCache));

  connection = new OkUrlFactory(client).open(serverUrl);
  connection.setRequestProperty("key1", "value1");

  executeGet(connection);
}
项目:PriorityOkHttp    文件:CacheAdapterTest.java   
@Test public void get_httpsGet() throws Exception {
  final URL serverUrl = configureHttpsServer(new MockResponse());
  assertEquals("https", serverUrl.getProtocol());

  ResponseCache responseCache = new AbstractResponseCache() {
    @Override public CacheResponse get(URI uri, String method, Map<String, List<String>> headers)
        throws IOException {
      assertEquals("https", uri.getScheme());
      assertEquals(toUri(serverUrl), uri);
      assertEquals("GET", method);
      assertTrue("Arbitrary standard header not present", headers.containsKey("User-Agent"));
      assertEquals(Collections.singletonList("value1"), headers.get("key1"));
      return null;
    }
  };
  setInternalCache(new CacheAdapter(responseCache));
  client = client.newBuilder()
      .sslSocketFactory(sslContext.getSocketFactory())
      .hostnameVerifier(hostnameVerifier)
      .build();

  connection = new OkUrlFactory(client).open(serverUrl);
  connection.setRequestProperty("key1", "value1");

  executeGet(connection);
}
项目:PriorityOkHttp    文件:ResponseCacheTest.java   
@Test public void otherStacks_cacheHitWithoutVary() throws Exception {
  server.enqueue(new MockResponse()
      .addHeader("Cache-Control: max-age=60")
      .setBody("A"));
  server.enqueue(new MockResponse()
      .setBody("FAIL"));

  // Set the cache as the shared cache.
  ResponseCache.setDefault(cache);

  // Use the platform's HTTP stack.
  URLConnection connection = server.url("/").url().openConnection();
  assertFalse(connection instanceof HttpURLConnectionImpl);
  assertEquals("A", readAscii(connection));

  URLConnection connection2 = server.url("/").url().openConnection();
  assertFalse(connection2 instanceof HttpURLConnectionImpl);
  assertEquals("A", readAscii(connection2));
}
项目:PriorityOkHttp    文件:ResponseCacheTest.java   
@Test public void otherStacks_cacheMissWithVaryAcceptEncoding() throws Exception {
  server.enqueue(new MockResponse()
      .addHeader("Cache-Control: max-age=60")
      .addHeader("Vary: Accept-Encoding")
      .setBody("A"));
  server.enqueue(new MockResponse()
      .setBody("B"));

  // Set the cache as the shared cache.
  ResponseCache.setDefault(cache);

  // Use the platform's HTTP stack.
  URLConnection connection = server.url("/").url().openConnection();
  assertFalse(connection instanceof HttpURLConnectionImpl);
  assertEquals("A", readAscii(connection));

  URLConnection connection2 = server.url("/").url().openConnection();
  assertFalse(connection2 instanceof HttpURLConnectionImpl);
  assertEquals("B", readAscii(connection2));
}
项目:PriorityOkHttp    文件:ResponseCacheTest.java   
@Test public void otherStacks_cacheMissWithVary() throws Exception {
  server.enqueue(new MockResponse()
      .addHeader("Cache-Control: max-age=60")
      .addHeader("Vary: Accept-Language")
      .setBody("A"));
  server.enqueue(new MockResponse()
      .setBody("B"));

  // Set the cache as the shared cache.
  ResponseCache.setDefault(cache);

  // Use the platform's HTTP stack.
  URLConnection connection = server.url("/").url().openConnection();
  assertFalse(connection instanceof HttpURLConnectionImpl);
  connection.setRequestProperty("Accept-Language", "en-US");
  assertEquals("A", readAscii(connection));

  URLConnection connection2 = server.url("/").url().openConnection();
  assertFalse(connection2 instanceof HttpURLConnectionImpl);
  assertEquals("B", readAscii(connection2));
}
项目:PriorityOkHttp    文件:ResponseCacheTest.java   
@Test public void otherStacks_cacheMissWithVaryAsterisk() throws Exception {
  server.enqueue(new MockResponse()
      .addHeader("Cache-Control: max-age=60")
      .addHeader("Vary: *")
      .setBody("A"));
  server.enqueue(new MockResponse()
      .setBody("B"));

  // Set the cache as the shared cache.
  ResponseCache.setDefault(cache);

  // Use the platform's HTTP stack.
  URLConnection connection = server.url("/").url().openConnection();
  assertFalse(connection instanceof HttpURLConnectionImpl);
  assertEquals("A", readAscii(connection));

  URLConnection connection2 = server.url("/").url().openConnection();
  assertFalse(connection2 instanceof HttpURLConnectionImpl);
  assertEquals("B", readAscii(connection2));
}
项目:Okhttp    文件:CacheAdapterTest.java   
@Test public void get_httpGet() throws Exception {
  final URL serverUrl = configureServer(new MockResponse());
  assertEquals("http", serverUrl.getProtocol());

  ResponseCache responseCache = new AbstractResponseCache() {
    @Override public CacheResponse get(
        URI uri, String method, Map<String, List<String>> headers) throws IOException {
      try {
        assertEquals(toUri(serverUrl), uri);
        assertEquals("GET", method);
        assertTrue("Arbitrary standard header not present", headers.containsKey("User-Agent"));
        assertEquals(Collections.singletonList("value1"), headers.get("key1"));
        return null;
      } catch (Throwable t) {
        throw new IOException("unexpected cache failure", t);
      }
    }
  };
  setInternalCache(new CacheAdapter(responseCache));

  connection = new OkUrlFactory(client).open(serverUrl);
  connection.setRequestProperty("key1", "value1");

  executeGet(connection);
}
项目:Okhttp    文件:ResponseCacheTest.java   
@Test public void otherStacks_cacheHitWithoutVary() throws Exception {
  server.enqueue(new MockResponse()
      .addHeader("Cache-Control: max-age=60")
      .setBody("A"));
  server.enqueue(new MockResponse()
      .setBody("FAIL"));

  // Set the cache as the shared cache.
  ResponseCache.setDefault(cache);

  // Use the platform's HTTP stack.
  URLConnection connection = server.url("/").url().openConnection();
  assertFalse(connection instanceof OkHttpURLConnection);
  assertEquals("A", readAscii(connection));

  URLConnection connection2 = server.url("/").url().openConnection();
  assertFalse(connection2 instanceof OkHttpURLConnection);
  assertEquals("A", readAscii(connection2));
}
项目:Okhttp    文件:ResponseCacheTest.java   
@Test public void otherStacks_cacheMissWithVaryAcceptEncoding() throws Exception {
  server.enqueue(new MockResponse()
      .addHeader("Cache-Control: max-age=60")
      .addHeader("Vary: Accept-Encoding")
      .setBody("A"));
  server.enqueue(new MockResponse()
      .setBody("B"));

  // Set the cache as the shared cache.
  ResponseCache.setDefault(cache);

  // Use the platform's HTTP stack.
  URLConnection connection = server.url("/").url().openConnection();
  assertFalse(connection instanceof OkHttpURLConnection);
  assertEquals("A", readAscii(connection));

  URLConnection connection2 = server.url("/").url().openConnection();
  assertFalse(connection2 instanceof OkHttpURLConnection);
  assertEquals("B", readAscii(connection2));
}
项目:Okhttp    文件:ResponseCacheTest.java   
@Test public void otherStacks_cacheMissWithVary() throws Exception {
  server.enqueue(new MockResponse()
      .addHeader("Cache-Control: max-age=60")
      .addHeader("Vary: Accept-Language")
      .setBody("A"));
  server.enqueue(new MockResponse()
      .setBody("B"));

  // Set the cache as the shared cache.
  ResponseCache.setDefault(cache);

  // Use the platform's HTTP stack.
  URLConnection connection = server.url("/").url().openConnection();
  assertFalse(connection instanceof OkHttpURLConnection);
  connection.setRequestProperty("Accept-Language", "en-US");
  assertEquals("A", readAscii(connection));

  URLConnection connection2 = server.url("/").url().openConnection();
  assertFalse(connection2 instanceof OkHttpURLConnection);
  assertEquals("B", readAscii(connection2));
}
项目:Okhttp    文件:ResponseCacheTest.java   
@Test public void otherStacks_cacheMissWithVaryAsterisk() throws Exception {
  server.enqueue(new MockResponse()
      .addHeader("Cache-Control: max-age=60")
      .addHeader("Vary: *")
      .setBody("A"));
  server.enqueue(new MockResponse()
      .setBody("B"));

  // Set the cache as the shared cache.
  ResponseCache.setDefault(cache);

  // Use the platform's HTTP stack.
  URLConnection connection = server.url("/").url().openConnection();
  assertFalse(connection instanceof OkHttpURLConnection);
  assertEquals("A", readAscii(connection));

  URLConnection connection2 = server.url("/").url().openConnection();
  assertFalse(connection2 instanceof OkHttpURLConnection);
  assertEquals("B", readAscii(connection2));
}
项目:smart-mirror-app    文件:OkHttpClient.java   
/**
 * 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;
}
项目:cordova-plugin-background-mode    文件:OkHttpClient.java   
/**
 * 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;
}
项目:multirotorstuff-vtx-calc    文件:OkHttpClient.java   
/**
 * 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;
}
项目:L.TileLayer.Cordova    文件:OkHttpClient.java   
/**
 * 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;
}
项目:cordova-android-tv    文件:OkHttpClient.java   
/**
 * 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;
}
项目:Cordova-Locale-Plugin    文件:OkHttpClient.java   
/**
 * 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;
}
项目:gwt-material-phonegap    文件:OkHttpClient.java   
/**
 * 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;
}
项目:pubnub-rpi-smart-parking    文件:OkHttpClient.java   
/**
 * 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;
}
项目:IoTgo_Android_App    文件:OkHttpClient.java   
/**
 * 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;
}
项目:CanDoVS2015    文件:OkHttpClient.java   
/**
 * 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;
}
项目:krakn    文件:OkHttpClient.java   
/**
 * 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;
}
项目:krakn    文件:OkHttpClient.java   
/**
 * 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;
}
项目:krakn    文件:OkHttpClient.java   
/**
 * 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;
}
项目:wototoplayer    文件:OkHttpClient.java   
/**
 * 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;
}
项目:krakn    文件:OkHttpClient.java   
/**
 * 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;
}
项目:krakn    文件:OkHttpClient.java   
/**
 * 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;
}
项目:posjs2    文件:OkHttpClient.java   
/**
 * 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;
}