Back to project page callerid-for-android.
The source code is released under:
GNU General Public License
If you think the Android project callerid-for-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.squareup.okhttp.internal; /* w w w . ja v a2 s .c o m*/ import java.io.IOException; import java.net.Proxy; import java.net.URL; import java.net.URLConnection; import java.net.URLStreamHandler; import com.squareup.okhttp.OkHttpClient; public class OkHttpClientHandler extends URLStreamHandler { private final OkHttpClient okHttpClient; private final int defaultPort; public OkHttpClientHandler(OkHttpClient okHttpClient, int defaultPort) { this.okHttpClient = okHttpClient; this.defaultPort = defaultPort; } @Override protected URLConnection openConnection(URL url) throws IOException { return okHttpClient.open(url); } @Override protected URLConnection openConnection(URL url, Proxy proxy) throws IOException { // not yet implemented, see https://github.com/square/okhttp/issues/191 throw new UnsupportedOperationException("Not yet implemented"); //return okHttpClient.open(url, proxy); } @Override protected int getDefaultPort() { return defaultPort; } }