public class HttpHandler extends URLStreamHandler
| Constructor and Description |
|---|
HttpHandler() |
| Modifier and Type | Method and Description |
|---|---|
static OkUrlFactory |
createHttpOkUrlFactory(Proxy proxy)
Creates an OkHttpClient suitable for creating
HttpURLConnection instances on
Android. |
protected int |
getDefaultPort()
Returns the default port of the protocol used by the handled URL.
|
protected OkUrlFactory |
newOkUrlFactory(Proxy proxy) |
protected URLConnection |
openConnection(URL url)
Establishes a new connection to the resource specified by the URL
u. |
protected URLConnection |
openConnection(URL url,
Proxy proxy)
Establishes a new connection to the resource specified by the URL
u using the given proxy. |
equals, getHostAddress, hashCode, hostsEqual, parseURL, sameFile, setURL, setURL, toExternalFormprotected URLConnection openConnection(URL url) throws IOException
URLStreamHandleru. Since different protocols also have unique ways of connecting, it
must be overwritten by the subclass.openConnection in class URLStreamHandlerurl - the URL to the resource where a connection has to be opened.IOException - if an I/O error occurs during opening the connection.protected URLConnection openConnection(URL url, Proxy proxy) throws IOException
URLStreamHandleru using the given proxy. Since different protocols also have
unique ways of connecting, it must be overwritten by the subclass.openConnection in class URLStreamHandlerurl - the URL to the resource where a connection has to be opened.proxy - the proxy that is used to make the connection.IOException - if an I/O error occurs during opening the connection.protected int getDefaultPort()
URLStreamHandler-1.getDefaultPort in class URLStreamHandlerprotected OkUrlFactory newOkUrlFactory(Proxy proxy)
public static OkUrlFactory createHttpOkUrlFactory(Proxy proxy)
HttpURLConnection instances on
Android.