Java 类com.squareup.okhttp.internal.http.HttpsEngine 实例源码

项目:LoRaWAN-Smart-Parking    文件:Job.java   
HttpEngine newEngine(Connection connection) throws IOException {
  String protocol = request.url().getProtocol();
  RawHeaders requestHeaders = request.rawHeaders();
  if (protocol.equals("http")) {
    return new HttpEngine(client, this, request.method(), requestHeaders, connection, null);
  } else if (protocol.equals("https")) {
    return new HttpsEngine(client, this, request.method(), requestHeaders, connection, null);
  } else {
    throw new AssertionError();
  }
}
项目:LoRaWAN-Smart-Parking    文件:HttpResponseCache.java   
/**
 * Returns the SSL socket used by {@code httpConnection} for HTTPS, nor null
 * if the connection isn't using HTTPS. Since we permit redirects across
 * protocols (HTTP to HTTPS or vice versa), the implementation type of the
 * connection doesn't necessarily match the implementation type of its HTTP
 * engine.
 */
private SSLSocket getSslSocket(HttpURLConnection httpConnection) {
  HttpEngine engine = httpConnection instanceof HttpsURLConnectionImpl
      ? ((HttpsURLConnectionImpl) httpConnection).getHttpEngine()
      : ((HttpURLConnectionImpl) httpConnection).getHttpEngine();
  return engine instanceof HttpsEngine
      ? ((HttpsEngine) engine).getSslSocket()
      : null;
}
项目:LoRaWAN-Smart-Parking    文件:Job.java   
HttpEngine newEngine(Connection connection) throws IOException {
  String protocol = request.url().getProtocol();
  RawHeaders requestHeaders = request.rawHeaders();
  if (protocol.equals("http")) {
    return new HttpEngine(client, this, request.method(), requestHeaders, connection, null);
  } else if (protocol.equals("https")) {
    return new HttpsEngine(client, this, request.method(), requestHeaders, connection, null);
  } else {
    throw new AssertionError();
  }
}
项目:LoRaWAN-Smart-Parking    文件:HttpResponseCache.java   
/**
 * Returns the SSL socket used by {@code httpConnection} for HTTPS, nor null
 * if the connection isn't using HTTPS. Since we permit redirects across
 * protocols (HTTP to HTTPS or vice versa), the implementation type of the
 * connection doesn't necessarily match the implementation type of its HTTP
 * engine.
 */
private SSLSocket getSslSocket(HttpURLConnection httpConnection) {
  HttpEngine engine = httpConnection instanceof HttpsURLConnectionImpl
      ? ((HttpsURLConnectionImpl) httpConnection).getHttpEngine()
      : ((HttpURLConnectionImpl) httpConnection).getHttpEngine();
  return engine instanceof HttpsEngine
      ? ((HttpsEngine) engine).getSslSocket()
      : null;
}
项目:smart-mirror-app    文件:Job.java   
HttpEngine newEngine(Connection connection) throws IOException {
  String protocol = request.url().getProtocol();
  RawHeaders requestHeaders = request.rawHeaders();
  if (protocol.equals("http")) {
    return new HttpEngine(client, this, request.method(), requestHeaders, connection, null);
  } else if (protocol.equals("https")) {
    return new HttpsEngine(client, this, request.method(), requestHeaders, connection, null);
  } else {
    throw new AssertionError();
  }
}
项目:smart-mirror-app    文件:HttpResponseCache.java   
/**
 * Returns the SSL socket used by {@code httpConnection} for HTTPS, nor null
 * if the connection isn't using HTTPS. Since we permit redirects across
 * protocols (HTTP to HTTPS or vice versa), the implementation type of the
 * connection doesn't necessarily match the implementation type of its HTTP
 * engine.
 */
private SSLSocket getSslSocket(HttpURLConnection httpConnection) {
  HttpEngine engine = httpConnection instanceof HttpsURLConnectionImpl
      ? ((HttpsURLConnectionImpl) httpConnection).getHttpEngine()
      : ((HttpURLConnectionImpl) httpConnection).getHttpEngine();
  return engine instanceof HttpsEngine
      ? ((HttpsEngine) engine).getSslSocket()
      : null;
}
项目:cordova-plugin-background-mode    文件:Job.java   
HttpEngine newEngine(Connection connection) throws IOException {
  String protocol = request.url().getProtocol();
  RawHeaders requestHeaders = request.rawHeaders();
  if (protocol.equals("http")) {
    return new HttpEngine(client, this, request.method(), requestHeaders, connection, null);
  } else if (protocol.equals("https")) {
    return new HttpsEngine(client, this, request.method(), requestHeaders, connection, null);
  } else {
    throw new AssertionError();
  }
}
项目:cordova-plugin-background-mode    文件:HttpResponseCache.java   
/**
 * Returns the SSL socket used by {@code httpConnection} for HTTPS, nor null
 * if the connection isn't using HTTPS. Since we permit redirects across
 * protocols (HTTP to HTTPS or vice versa), the implementation type of the
 * connection doesn't necessarily match the implementation type of its HTTP
 * engine.
 */
private SSLSocket getSslSocket(HttpURLConnection httpConnection) {
  HttpEngine engine = httpConnection instanceof HttpsURLConnectionImpl
      ? ((HttpsURLConnectionImpl) httpConnection).getHttpEngine()
      : ((HttpURLConnectionImpl) httpConnection).getHttpEngine();
  return engine instanceof HttpsEngine
      ? ((HttpsEngine) engine).getSslSocket()
      : null;
}
项目:multirotorstuff-vtx-calc    文件:Job.java   
HttpEngine newEngine(Connection connection) throws IOException {
  String protocol = request.url().getProtocol();
  RawHeaders requestHeaders = request.rawHeaders();
  if (protocol.equals("http")) {
    return new HttpEngine(client, this, request.method(), requestHeaders, connection, null);
  } else if (protocol.equals("https")) {
    return new HttpsEngine(client, this, request.method(), requestHeaders, connection, null);
  } else {
    throw new AssertionError();
  }
}
项目:multirotorstuff-vtx-calc    文件:HttpResponseCache.java   
/**
 * Returns the SSL socket used by {@code httpConnection} for HTTPS, nor null
 * if the connection isn't using HTTPS. Since we permit redirects across
 * protocols (HTTP to HTTPS or vice versa), the implementation type of the
 * connection doesn't necessarily match the implementation type of its HTTP
 * engine.
 */
private SSLSocket getSslSocket(HttpURLConnection httpConnection) {
  HttpEngine engine = httpConnection instanceof HttpsURLConnectionImpl
      ? ((HttpsURLConnectionImpl) httpConnection).getHttpEngine()
      : ((HttpURLConnectionImpl) httpConnection).getHttpEngine();
  return engine instanceof HttpsEngine
      ? ((HttpsEngine) engine).getSslSocket()
      : null;
}
项目:L.TileLayer.Cordova    文件:Job.java   
HttpEngine newEngine(Connection connection) throws IOException {
  String protocol = request.url().getProtocol();
  RawHeaders requestHeaders = request.rawHeaders();
  if (protocol.equals("http")) {
    return new HttpEngine(client, this, request.method(), requestHeaders, connection, null);
  } else if (protocol.equals("https")) {
    return new HttpsEngine(client, this, request.method(), requestHeaders, connection, null);
  } else {
    throw new AssertionError();
  }
}
项目:L.TileLayer.Cordova    文件:HttpResponseCache.java   
/**
 * Returns the SSL socket used by {@code httpConnection} for HTTPS, nor null
 * if the connection isn't using HTTPS. Since we permit redirects across
 * protocols (HTTP to HTTPS or vice versa), the implementation type of the
 * connection doesn't necessarily match the implementation type of its HTTP
 * engine.
 */
private SSLSocket getSslSocket(HttpURLConnection httpConnection) {
  HttpEngine engine = httpConnection instanceof HttpsURLConnectionImpl
      ? ((HttpsURLConnectionImpl) httpConnection).getHttpEngine()
      : ((HttpURLConnectionImpl) httpConnection).getHttpEngine();
  return engine instanceof HttpsEngine
      ? ((HttpsEngine) engine).getSslSocket()
      : null;
}
项目:cordova-android-tv    文件:Job.java   
HttpEngine newEngine(Connection connection) throws IOException {
  String protocol = request.url().getProtocol();
  RawHeaders requestHeaders = request.rawHeaders();
  if (protocol.equals("http")) {
    return new HttpEngine(client, this, request.method(), requestHeaders, connection, null);
  } else if (protocol.equals("https")) {
    return new HttpsEngine(client, this, request.method(), requestHeaders, connection, null);
  } else {
    throw new AssertionError();
  }
}
项目:cordova-android-tv    文件:HttpResponseCache.java   
/**
 * Returns the SSL socket used by {@code httpConnection} for HTTPS, nor null
 * if the connection isn't using HTTPS. Since we permit redirects across
 * protocols (HTTP to HTTPS or vice versa), the implementation type of the
 * connection doesn't necessarily match the implementation type of its HTTP
 * engine.
 */
private SSLSocket getSslSocket(HttpURLConnection httpConnection) {
  HttpEngine engine = httpConnection instanceof HttpsURLConnectionImpl
      ? ((HttpsURLConnectionImpl) httpConnection).getHttpEngine()
      : ((HttpURLConnectionImpl) httpConnection).getHttpEngine();
  return engine instanceof HttpsEngine
      ? ((HttpsEngine) engine).getSslSocket()
      : null;
}
项目:Cordova-Locale-Plugin    文件:Job.java   
HttpEngine newEngine(Connection connection) throws IOException {
  String protocol = request.url().getProtocol();
  RawHeaders requestHeaders = request.rawHeaders();
  if (protocol.equals("http")) {
    return new HttpEngine(client, this, request.method(), requestHeaders, connection, null);
  } else if (protocol.equals("https")) {
    return new HttpsEngine(client, this, request.method(), requestHeaders, connection, null);
  } else {
    throw new AssertionError();
  }
}
项目:Cordova-Locale-Plugin    文件:HttpResponseCache.java   
/**
 * Returns the SSL socket used by {@code httpConnection} for HTTPS, nor null
 * if the connection isn't using HTTPS. Since we permit redirects across
 * protocols (HTTP to HTTPS or vice versa), the implementation type of the
 * connection doesn't necessarily match the implementation type of its HTTP
 * engine.
 */
private SSLSocket getSslSocket(HttpURLConnection httpConnection) {
  HttpEngine engine = httpConnection instanceof HttpsURLConnectionImpl
      ? ((HttpsURLConnectionImpl) httpConnection).getHttpEngine()
      : ((HttpURLConnectionImpl) httpConnection).getHttpEngine();
  return engine instanceof HttpsEngine
      ? ((HttpsEngine) engine).getSslSocket()
      : null;
}
项目:pubnub-rpi-smart-parking    文件:Job.java   
HttpEngine newEngine(Connection connection) throws IOException {
  String protocol = request.url().getProtocol();
  RawHeaders requestHeaders = request.rawHeaders();
  if (protocol.equals("http")) {
    return new HttpEngine(client, this, request.method(), requestHeaders, connection, null);
  } else if (protocol.equals("https")) {
    return new HttpsEngine(client, this, request.method(), requestHeaders, connection, null);
  } else {
    throw new AssertionError();
  }
}
项目:pubnub-rpi-smart-parking    文件:HttpResponseCache.java   
/**
 * Returns the SSL socket used by {@code httpConnection} for HTTPS, nor null
 * if the connection isn't using HTTPS. Since we permit redirects across
 * protocols (HTTP to HTTPS or vice versa), the implementation type of the
 * connection doesn't necessarily match the implementation type of its HTTP
 * engine.
 */
private SSLSocket getSslSocket(HttpURLConnection httpConnection) {
  HttpEngine engine = httpConnection instanceof HttpsURLConnectionImpl
      ? ((HttpsURLConnectionImpl) httpConnection).getHttpEngine()
      : ((HttpURLConnectionImpl) httpConnection).getHttpEngine();
  return engine instanceof HttpsEngine
      ? ((HttpsEngine) engine).getSslSocket()
      : null;
}
项目:IoTgo_Android_App    文件:Job.java   
HttpEngine newEngine(Connection connection) throws IOException {
  String protocol = request.url().getProtocol();
  RawHeaders requestHeaders = request.rawHeaders();
  if (protocol.equals("http")) {
    return new HttpEngine(client, this, request.method(), requestHeaders, connection, null);
  } else if (protocol.equals("https")) {
    return new HttpsEngine(client, this, request.method(), requestHeaders, connection, null);
  } else {
    throw new AssertionError();
  }
}
项目:IoTgo_Android_App    文件:HttpResponseCache.java   
/**
 * Returns the SSL socket used by {@code httpConnection} for HTTPS, nor null
 * if the connection isn't using HTTPS. Since we permit redirects across
 * protocols (HTTP to HTTPS or vice versa), the implementation type of the
 * connection doesn't necessarily match the implementation type of its HTTP
 * engine.
 */
private SSLSocket getSslSocket(HttpURLConnection httpConnection) {
  HttpEngine engine = httpConnection instanceof HttpsURLConnectionImpl
      ? ((HttpsURLConnectionImpl) httpConnection).getHttpEngine()
      : ((HttpURLConnectionImpl) httpConnection).getHttpEngine();
  return engine instanceof HttpsEngine
      ? ((HttpsEngine) engine).getSslSocket()
      : null;
}
项目:CanDoVS2015    文件:Job.java   
HttpEngine newEngine(Connection connection) throws IOException {
  String protocol = request.url().getProtocol();
  RawHeaders requestHeaders = request.rawHeaders();
  if (protocol.equals("http")) {
    return new HttpEngine(client, this, request.method(), requestHeaders, connection, null);
  } else if (protocol.equals("https")) {
    return new HttpsEngine(client, this, request.method(), requestHeaders, connection, null);
  } else {
    throw new AssertionError();
  }
}
项目:CanDoVS2015    文件:HttpResponseCache.java   
/**
 * Returns the SSL socket used by {@code httpConnection} for HTTPS, nor null
 * if the connection isn't using HTTPS. Since we permit redirects across
 * protocols (HTTP to HTTPS or vice versa), the implementation type of the
 * connection doesn't necessarily match the implementation type of its HTTP
 * engine.
 */
private SSLSocket getSslSocket(HttpURLConnection httpConnection) {
  HttpEngine engine = httpConnection instanceof HttpsURLConnectionImpl
      ? ((HttpsURLConnectionImpl) httpConnection).getHttpEngine()
      : ((HttpURLConnectionImpl) httpConnection).getHttpEngine();
  return engine instanceof HttpsEngine
      ? ((HttpsEngine) engine).getSslSocket()
      : null;
}
项目:krakn    文件:Job.java   
HttpEngine newEngine(Connection connection) throws IOException {
  String protocol = request.url().getProtocol();
  RawHeaders requestHeaders = request.rawHeaders();
  if (protocol.equals("http")) {
    return new HttpEngine(client, this, request.method(), requestHeaders, connection, null);
  } else if (protocol.equals("https")) {
    return new HttpsEngine(client, this, request.method(), requestHeaders, connection, null);
  } else {
    throw new AssertionError();
  }
}
项目:krakn    文件:HttpResponseCache.java   
/**
 * Returns the SSL socket used by {@code httpConnection} for HTTPS, nor null
 * if the connection isn't using HTTPS. Since we permit redirects across
 * protocols (HTTP to HTTPS or vice versa), the implementation type of the
 * connection doesn't necessarily match the implementation type of its HTTP
 * engine.
 */
private SSLSocket getSslSocket(HttpURLConnection httpConnection) {
  HttpEngine engine = httpConnection instanceof HttpsURLConnectionImpl
      ? ((HttpsURLConnectionImpl) httpConnection).getHttpEngine()
      : ((HttpURLConnectionImpl) httpConnection).getHttpEngine();
  return engine instanceof HttpsEngine
      ? ((HttpsEngine) engine).getSslSocket()
      : null;
}
项目:krakn    文件:Job.java   
HttpEngine newEngine(Connection connection) throws IOException {
  String protocol = request.url().getProtocol();
  RawHeaders requestHeaders = request.rawHeaders();
  if (protocol.equals("http")) {
    return new HttpEngine(client, this, request.method(), requestHeaders, connection, null);
  } else if (protocol.equals("https")) {
    return new HttpsEngine(client, this, request.method(), requestHeaders, connection, null);
  } else {
    throw new AssertionError();
  }
}
项目:krakn    文件:HttpResponseCache.java   
/**
 * Returns the SSL socket used by {@code httpConnection} for HTTPS, nor null
 * if the connection isn't using HTTPS. Since we permit redirects across
 * protocols (HTTP to HTTPS or vice versa), the implementation type of the
 * connection doesn't necessarily match the implementation type of its HTTP
 * engine.
 */
private SSLSocket getSslSocket(HttpURLConnection httpConnection) {
  HttpEngine engine = httpConnection instanceof HttpsURLConnectionImpl
      ? ((HttpsURLConnectionImpl) httpConnection).getHttpEngine()
      : ((HttpURLConnectionImpl) httpConnection).getHttpEngine();
  return engine instanceof HttpsEngine
      ? ((HttpsEngine) engine).getSslSocket()
      : null;
}
项目:krakn    文件:Job.java   
HttpEngine newEngine(Connection connection) throws IOException {
  String protocol = request.url().getProtocol();
  RawHeaders requestHeaders = request.rawHeaders();
  if (protocol.equals("http")) {
    return new HttpEngine(client, this, request.method(), requestHeaders, connection, null);
  } else if (protocol.equals("https")) {
    return new HttpsEngine(client, this, request.method(), requestHeaders, connection, null);
  } else {
    throw new AssertionError();
  }
}
项目:krakn    文件:HttpResponseCache.java   
/**
 * Returns the SSL socket used by {@code httpConnection} for HTTPS, nor null
 * if the connection isn't using HTTPS. Since we permit redirects across
 * protocols (HTTP to HTTPS or vice versa), the implementation type of the
 * connection doesn't necessarily match the implementation type of its HTTP
 * engine.
 */
private SSLSocket getSslSocket(HttpURLConnection httpConnection) {
  HttpEngine engine = httpConnection instanceof HttpsURLConnectionImpl
      ? ((HttpsURLConnectionImpl) httpConnection).getHttpEngine()
      : ((HttpURLConnectionImpl) httpConnection).getHttpEngine();
  return engine instanceof HttpsEngine
      ? ((HttpsEngine) engine).getSslSocket()
      : null;
}
项目:krakn    文件:Job.java   
HttpEngine newEngine(Connection connection) throws IOException {
  String protocol = request.url().getProtocol();
  RawHeaders requestHeaders = request.rawHeaders();
  if (protocol.equals("http")) {
    return new HttpEngine(client, this, request.method(), requestHeaders, connection, null);
  } else if (protocol.equals("https")) {
    return new HttpsEngine(client, this, request.method(), requestHeaders, connection, null);
  } else {
    throw new AssertionError();
  }
}
项目:krakn    文件:HttpResponseCache.java   
/**
 * Returns the SSL socket used by {@code httpConnection} for HTTPS, nor null
 * if the connection isn't using HTTPS. Since we permit redirects across
 * protocols (HTTP to HTTPS or vice versa), the implementation type of the
 * connection doesn't necessarily match the implementation type of its HTTP
 * engine.
 */
private SSLSocket getSslSocket(HttpURLConnection httpConnection) {
  HttpEngine engine = httpConnection instanceof HttpsURLConnectionImpl
      ? ((HttpsURLConnectionImpl) httpConnection).getHttpEngine()
      : ((HttpURLConnectionImpl) httpConnection).getHttpEngine();
  return engine instanceof HttpsEngine
      ? ((HttpsEngine) engine).getSslSocket()
      : null;
}
项目:krakn    文件:Job.java   
HttpEngine newEngine(Connection connection) throws IOException {
  String protocol = request.url().getProtocol();
  RawHeaders requestHeaders = request.rawHeaders();
  if (protocol.equals("http")) {
    return new HttpEngine(client, this, request.method(), requestHeaders, connection, null);
  } else if (protocol.equals("https")) {
    return new HttpsEngine(client, this, request.method(), requestHeaders, connection, null);
  } else {
    throw new AssertionError();
  }
}
项目:krakn    文件:HttpResponseCache.java   
/**
 * Returns the SSL socket used by {@code httpConnection} for HTTPS, nor null
 * if the connection isn't using HTTPS. Since we permit redirects across
 * protocols (HTTP to HTTPS or vice versa), the implementation type of the
 * connection doesn't necessarily match the implementation type of its HTTP
 * engine.
 */
private SSLSocket getSslSocket(HttpURLConnection httpConnection) {
  HttpEngine engine = httpConnection instanceof HttpsURLConnectionImpl
      ? ((HttpsURLConnectionImpl) httpConnection).getHttpEngine()
      : ((HttpURLConnectionImpl) httpConnection).getHttpEngine();
  return engine instanceof HttpsEngine
      ? ((HttpsEngine) engine).getSslSocket()
      : null;
}
项目:posjs2    文件:Job.java   
HttpEngine newEngine(Connection connection) throws IOException {
  String protocol = request.url().getProtocol();
  RawHeaders requestHeaders = request.rawHeaders();
  if (protocol.equals("http")) {
    return new HttpEngine(client, this, request.method(), requestHeaders, connection, null);
  } else if (protocol.equals("https")) {
    return new HttpsEngine(client, this, request.method(), requestHeaders, connection, null);
  } else {
    throw new AssertionError();
  }
}
项目:posjs2    文件:HttpResponseCache.java   
/**
 * Returns the SSL socket used by {@code httpConnection} for HTTPS, nor null
 * if the connection isn't using HTTPS. Since we permit redirects across
 * protocols (HTTP to HTTPS or vice versa), the implementation type of the
 * connection doesn't necessarily match the implementation type of its HTTP
 * engine.
 */
private SSLSocket getSslSocket(HttpURLConnection httpConnection) {
  HttpEngine engine = httpConnection instanceof HttpsURLConnectionImpl
      ? ((HttpsURLConnectionImpl) httpConnection).getHttpEngine()
      : ((HttpURLConnectionImpl) httpConnection).getHttpEngine();
  return engine instanceof HttpsEngine
      ? ((HttpsEngine) engine).getSslSocket()
      : null;
}
项目:hustElectricity    文件:Job.java   
HttpEngine newEngine(Connection connection) throws IOException {
  String protocol = request.url().getProtocol();
  RawHeaders requestHeaders = request.rawHeaders();
  if (protocol.equals("http")) {
    return new HttpEngine(client, this, request.method(), requestHeaders, connection, null);
  } else if (protocol.equals("https")) {
    return new HttpsEngine(client, this, request.method(), requestHeaders, connection, null);
  } else {
    throw new AssertionError();
  }
}
项目:hustElectricity    文件:HttpResponseCache.java   
/**
 * Returns the SSL socket used by {@code httpConnection} for HTTPS, nor null
 * if the connection isn't using HTTPS. Since we permit redirects across
 * protocols (HTTP to HTTPS or vice versa), the implementation type of the
 * connection doesn't necessarily match the implementation type of its HTTP
 * engine.
 */
private SSLSocket getSslSocket(HttpURLConnection httpConnection) {
  HttpEngine engine = httpConnection instanceof HttpsURLConnectionImpl
      ? ((HttpsURLConnectionImpl) httpConnection).getHttpEngine()
      : ((HttpURLConnectionImpl) httpConnection).getHttpEngine();
  return engine instanceof HttpsEngine
      ? ((HttpsEngine) engine).getSslSocket()
      : null;
}
项目:Wetube    文件:Job.java   
HttpEngine newEngine(Connection connection) throws IOException {
  String protocol = request.url().getProtocol();
  RawHeaders requestHeaders = request.rawHeaders();
  if (protocol.equals("http")) {
    return new HttpEngine(client, this, request.method(), requestHeaders, connection, null);
  } else if (protocol.equals("https")) {
    return new HttpsEngine(client, this, request.method(), requestHeaders, connection, null);
  } else {
    throw new AssertionError();
  }
}
项目:Wetube    文件:HttpResponseCache.java   
/**
 * Returns the SSL socket used by {@code httpConnection} for HTTPS, nor null
 * if the connection isn't using HTTPS. Since we permit redirects across
 * protocols (HTTP to HTTPS or vice versa), the implementation type of the
 * connection doesn't necessarily match the implementation type of its HTTP
 * engine.
 */
private SSLSocket getSslSocket(HttpURLConnection httpConnection) {
  HttpEngine engine = httpConnection instanceof HttpsURLConnectionImpl
      ? ((HttpsURLConnectionImpl) httpConnection).getHttpEngine()
      : ((HttpURLConnectionImpl) httpConnection).getHttpEngine();
  return engine instanceof HttpsEngine
      ? ((HttpsEngine) engine).getSslSocket()
      : null;
}
项目:DemoArduinoAndroidCordovaBT    文件:Job.java   
HttpEngine newEngine(Connection connection) throws IOException {
  String protocol = request.url().getProtocol();
  RawHeaders requestHeaders = request.rawHeaders();
  if (protocol.equals("http")) {
    return new HttpEngine(client, this, request.method(), requestHeaders, connection, null);
  } else if (protocol.equals("https")) {
    return new HttpsEngine(client, this, request.method(), requestHeaders, connection, null);
  } else {
    throw new AssertionError();
  }
}
项目:DemoArduinoAndroidCordovaBT    文件:HttpResponseCache.java   
/**
 * Returns the SSL socket used by {@code httpConnection} for HTTPS, nor null
 * if the connection isn't using HTTPS. Since we permit redirects across
 * protocols (HTTP to HTTPS or vice versa), the implementation type of the
 * connection doesn't necessarily match the implementation type of its HTTP
 * engine.
 */
private SSLSocket getSslSocket(HttpURLConnection httpConnection) {
  HttpEngine engine = httpConnection instanceof HttpsURLConnectionImpl
      ? ((HttpsURLConnectionImpl) httpConnection).getHttpEngine()
      : ((HttpURLConnectionImpl) httpConnection).getHttpEngine();
  return engine instanceof HttpsEngine
      ? ((HttpsEngine) engine).getSslSocket()
      : null;
}