Java Code Examples for com.squareup.okhttp.internal.http.HttpTransport

The following are top voted examples for showing how to use com.squareup.okhttp.internal.http.HttpTransport. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: AtlasForAndroid   File: BundleArchiveRevision.java   View source code 5 votes vote down vote up
public void installSoLib(File file) {
    try {
        ZipFile zipFile = new ZipFile(file);
        Enumeration entries = zipFile.entries();
        while (entries.hasMoreElements()) {
            ZipEntry zipEntry = (ZipEntry) entries.nextElement();
            String name = zipEntry.getName();
            String str = "armeabi";
            if (Build.CPU_ABI.contains("x86")) {
                str = "x86";
            }
            if (name.indexOf(String.format("%s%s", new Object[]{"lib/", str})) != -1) {
                str = String.format("%s%s%s%s%s", new Object[]{this.revisionDir, File.separator, "lib", File.separator, name.substring(name.lastIndexOf(File.separator) + 1, name.length())});
                if (zipEntry.isDirectory()) {
                    File file2 = new File(str);
                    if (!file2.exists()) {
                        file2.mkdirs();
                    }
                } else {
                    File file3 = new File(str.substring(0, str.lastIndexOf(FilePathGenerator.ANDROID_DIR_SEP)));
                    if (!file3.exists()) {
                        file3.mkdirs();
                    }
                    BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(new FileOutputStream(str));
                    BufferedInputStream bufferedInputStream = new BufferedInputStream(zipFile.getInputStream(zipEntry));
                    byte[] bArr = new byte[HttpTransport.DEFAULT_CHUNK_LENGTH];
                    for (int read = bufferedInputStream.read(bArr); read != -1; read = bufferedInputStream.read(bArr)) {
                        bufferedOutputStream.write(bArr, 0, read);
                    }
                    bufferedOutputStream.close();
                }
            }
        }
        zipFile.close();
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
Example 2
Project: LoRaWAN-Smart-Parking   File: Connection.java   View source code 4 votes vote down vote up
/** Returns the transport appropriate for this connection. */
public Object newTransport(HttpEngine httpEngine) throws IOException {
  return (spdyConnection != null)
      ? new SpdyTransport(httpEngine, spdyConnection)
      : new HttpTransport(httpEngine, out, in);
}
 
Example 3
Project: LoRaWAN-Smart-Parking   File: Job.java   View source code 4 votes vote down vote up
@Override public int getChunkLength() {
  return request.body().contentLength() == -1 ? HttpTransport.DEFAULT_CHUNK_LENGTH : -1;
}
 
Example 4
Project: LoRaWAN-Smart-Parking   File: Connection.java   View source code 4 votes vote down vote up
/** Returns the transport appropriate for this connection. */
public Object newTransport(HttpEngine httpEngine) throws IOException {
  return (spdyConnection != null)
      ? new SpdyTransport(httpEngine, spdyConnection)
      : new HttpTransport(httpEngine, out, in);
}
 
Example 5
Project: LoRaWAN-Smart-Parking   File: Job.java   View source code 4 votes vote down vote up
@Override public int getChunkLength() {
  return request.body().contentLength() == -1 ? HttpTransport.DEFAULT_CHUNK_LENGTH : -1;
}
 
Example 6
Project: smart-mirror-app   File: Connection.java   View source code 4 votes vote down vote up
/** Returns the transport appropriate for this connection. */
public Object newTransport(HttpEngine httpEngine) throws IOException {
  return (spdyConnection != null)
      ? new SpdyTransport(httpEngine, spdyConnection)
      : new HttpTransport(httpEngine, out, in);
}
 
Example 7
Project: smart-mirror-app   File: Job.java   View source code 4 votes vote down vote up
@Override public int getChunkLength() {
  return request.body().contentLength() == -1 ? HttpTransport.DEFAULT_CHUNK_LENGTH : -1;
}
 
Example 8
Project: cordova-plugin-background-mode   File: Connection.java   View source code 4 votes vote down vote up
/** Returns the transport appropriate for this connection. */
public Object newTransport(HttpEngine httpEngine) throws IOException {
  return (spdyConnection != null)
      ? new SpdyTransport(httpEngine, spdyConnection)
      : new HttpTransport(httpEngine, out, in);
}
 
Example 9
Project: cordova-plugin-background-mode   File: Job.java   View source code 4 votes vote down vote up
@Override public int getChunkLength() {
  return request.body().contentLength() == -1 ? HttpTransport.DEFAULT_CHUNK_LENGTH : -1;
}
 
Example 10
Project: multirotorstuff-vtx-calc   File: Connection.java   View source code 4 votes vote down vote up
/** Returns the transport appropriate for this connection. */
public Object newTransport(HttpEngine httpEngine) throws IOException {
  return (spdyConnection != null)
      ? new SpdyTransport(httpEngine, spdyConnection)
      : new HttpTransport(httpEngine, out, in);
}
 
Example 11
Project: multirotorstuff-vtx-calc   File: Job.java   View source code 4 votes vote down vote up
@Override public int getChunkLength() {
  return request.body().contentLength() == -1 ? HttpTransport.DEFAULT_CHUNK_LENGTH : -1;
}
 
Example 12
Project: L.TileLayer.Cordova   File: Connection.java   View source code 4 votes vote down vote up
/** Returns the transport appropriate for this connection. */
public Object newTransport(HttpEngine httpEngine) throws IOException {
  return (spdyConnection != null)
      ? new SpdyTransport(httpEngine, spdyConnection)
      : new HttpTransport(httpEngine, out, in);
}
 
Example 13
Project: L.TileLayer.Cordova   File: Job.java   View source code 4 votes vote down vote up
@Override public int getChunkLength() {
  return request.body().contentLength() == -1 ? HttpTransport.DEFAULT_CHUNK_LENGTH : -1;
}
 
Example 14
Project: cordova-android-tv   File: Connection.java   View source code 4 votes vote down vote up
/** Returns the transport appropriate for this connection. */
public Object newTransport(HttpEngine httpEngine) throws IOException {
  return (spdyConnection != null)
      ? new SpdyTransport(httpEngine, spdyConnection)
      : new HttpTransport(httpEngine, out, in);
}
 
Example 15
Project: cordova-android-tv   File: Job.java   View source code 4 votes vote down vote up
@Override public int getChunkLength() {
  return request.body().contentLength() == -1 ? HttpTransport.DEFAULT_CHUNK_LENGTH : -1;
}
 
Example 16
Project: Cordova-Locale-Plugin   File: Connection.java   View source code 4 votes vote down vote up
/** Returns the transport appropriate for this connection. */
public Object newTransport(HttpEngine httpEngine) throws IOException {
  return (spdyConnection != null)
      ? new SpdyTransport(httpEngine, spdyConnection)
      : new HttpTransport(httpEngine, out, in);
}
 
Example 17
Project: Cordova-Locale-Plugin   File: Job.java   View source code 4 votes vote down vote up
@Override public int getChunkLength() {
  return request.body().contentLength() == -1 ? HttpTransport.DEFAULT_CHUNK_LENGTH : -1;
}
 
Example 18
Project: pubnub-rpi-smart-parking   File: Connection.java   View source code 4 votes vote down vote up
/** Returns the transport appropriate for this connection. */
public Object newTransport(HttpEngine httpEngine) throws IOException {
  return (spdyConnection != null)
      ? new SpdyTransport(httpEngine, spdyConnection)
      : new HttpTransport(httpEngine, out, in);
}
 
Example 19
Project: pubnub-rpi-smart-parking   File: Job.java   View source code 4 votes vote down vote up
@Override public int getChunkLength() {
  return request.body().contentLength() == -1 ? HttpTransport.DEFAULT_CHUNK_LENGTH : -1;
}
 
Example 20
Project: IoTgo_Android_App   File: Connection.java   View source code 4 votes vote down vote up
/** Returns the transport appropriate for this connection. */
public Object newTransport(HttpEngine httpEngine) throws IOException {
  return (spdyConnection != null)
      ? new SpdyTransport(httpEngine, spdyConnection)
      : new HttpTransport(httpEngine, out, in);
}
 
Example 21
Project: IoTgo_Android_App   File: Job.java   View source code 4 votes vote down vote up
@Override public int getChunkLength() {
  return request.body().contentLength() == -1 ? HttpTransport.DEFAULT_CHUNK_LENGTH : -1;
}
 
Example 22
Project: CanDoVS2015   File: Connection.java   View source code 4 votes vote down vote up
/** Returns the transport appropriate for this connection. */
public Object newTransport(HttpEngine httpEngine) throws IOException {
  return (spdyConnection != null)
      ? new SpdyTransport(httpEngine, spdyConnection)
      : new HttpTransport(httpEngine, out, in);
}
 
Example 23
Project: CanDoVS2015   File: Job.java   View source code 4 votes vote down vote up
@Override public int getChunkLength() {
  return request.body().contentLength() == -1 ? HttpTransport.DEFAULT_CHUNK_LENGTH : -1;
}
 
Example 24
Project: krakn   File: Connection.java   View source code 4 votes vote down vote up
/** Returns the transport appropriate for this connection. */
public Object newTransport(HttpEngine httpEngine) throws IOException {
  return (spdyConnection != null)
      ? new SpdyTransport(httpEngine, spdyConnection)
      : new HttpTransport(httpEngine, out, in);
}
 
Example 25
Project: krakn   File: Job.java   View source code 4 votes vote down vote up
@Override public int getChunkLength() {
  return request.body().contentLength() == -1 ? HttpTransport.DEFAULT_CHUNK_LENGTH : -1;
}
 
Example 26
Project: krakn   File: Connection.java   View source code 4 votes vote down vote up
/** Returns the transport appropriate for this connection. */
public Object newTransport(HttpEngine httpEngine) throws IOException {
  return (spdyConnection != null)
      ? new SpdyTransport(httpEngine, spdyConnection)
      : new HttpTransport(httpEngine, out, in);
}
 
Example 27
Project: krakn   File: Job.java   View source code 4 votes vote down vote up
@Override public int getChunkLength() {
  return request.body().contentLength() == -1 ? HttpTransport.DEFAULT_CHUNK_LENGTH : -1;
}
 
Example 28
Project: krakn   File: Connection.java   View source code 4 votes vote down vote up
/** Returns the transport appropriate for this connection. */
public Object newTransport(HttpEngine httpEngine) throws IOException {
  return (spdyConnection != null)
      ? new SpdyTransport(httpEngine, spdyConnection)
      : new HttpTransport(httpEngine, out, in);
}
 
Example 29
Project: krakn   File: Job.java   View source code 4 votes vote down vote up
@Override public int getChunkLength() {
  return request.body().contentLength() == -1 ? HttpTransport.DEFAULT_CHUNK_LENGTH : -1;
}
 
Example 30
Project: krakn   File: Connection.java   View source code 4 votes vote down vote up
/** Returns the transport appropriate for this connection. */
public Object newTransport(HttpEngine httpEngine) throws IOException {
  return (spdyConnection != null)
      ? new SpdyTransport(httpEngine, spdyConnection)
      : new HttpTransport(httpEngine, out, in);
}
 
Example 31
Project: krakn   File: Job.java   View source code 4 votes vote down vote up
@Override public int getChunkLength() {
  return request.body().contentLength() == -1 ? HttpTransport.DEFAULT_CHUNK_LENGTH : -1;
}
 
Example 32
Project: krakn   File: Connection.java   View source code 4 votes vote down vote up
/** Returns the transport appropriate for this connection. */
public Object newTransport(HttpEngine httpEngine) throws IOException {
  return (spdyConnection != null)
      ? new SpdyTransport(httpEngine, spdyConnection)
      : new HttpTransport(httpEngine, out, in);
}
 
Example 33
Project: krakn   File: Job.java   View source code 4 votes vote down vote up
@Override public int getChunkLength() {
  return request.body().contentLength() == -1 ? HttpTransport.DEFAULT_CHUNK_LENGTH : -1;
}
 
Example 34
Project: posjs2   File: Connection.java   View source code 4 votes vote down vote up
/** Returns the transport appropriate for this connection. */
public Object newTransport(HttpEngine httpEngine) throws IOException {
  return (spdyConnection != null)
      ? new SpdyTransport(httpEngine, spdyConnection)
      : new HttpTransport(httpEngine, out, in);
}
 
Example 35
Project: posjs2   File: Job.java   View source code 4 votes vote down vote up
@Override public int getChunkLength() {
  return request.body().contentLength() == -1 ? HttpTransport.DEFAULT_CHUNK_LENGTH : -1;
}
 
Example 36
Project: hustElectricity   File: Connection.java   View source code 4 votes vote down vote up
/** Returns the transport appropriate for this connection. */
public Object newTransport(HttpEngine httpEngine) throws IOException {
  return (spdyConnection != null)
      ? new SpdyTransport(httpEngine, spdyConnection)
      : new HttpTransport(httpEngine, out, in);
}
 
Example 37
Project: hustElectricity   File: Job.java   View source code 4 votes vote down vote up
@Override public int getChunkLength() {
  return request.body().contentLength() == -1 ? HttpTransport.DEFAULT_CHUNK_LENGTH : -1;
}
 
Example 38
Project: Wetube   File: Connection.java   View source code 4 votes vote down vote up
/** Returns the transport appropriate for this connection. */
public Object newTransport(HttpEngine httpEngine) throws IOException {
  return (spdyConnection != null)
      ? new SpdyTransport(httpEngine, spdyConnection)
      : new HttpTransport(httpEngine, out, in);
}
 
Example 39
Project: Wetube   File: Job.java   View source code 4 votes vote down vote up
@Override public int getChunkLength() {
  return request.body().contentLength() == -1 ? HttpTransport.DEFAULT_CHUNK_LENGTH : -1;
}
 
Example 40
Project: DemoArduinoAndroidCordovaBT   File: Connection.java   View source code 4 votes vote down vote up
/** Returns the transport appropriate for this connection. */
public Object newTransport(HttpEngine httpEngine) throws IOException {
  return (spdyConnection != null)
      ? new SpdyTransport(httpEngine, spdyConnection)
      : new HttpTransport(httpEngine, out, in);
}