public OkHttpsURLConnection(URL url, OkHttpClient client, URLFilter filter) { this(new OkHttpURLConnection(url, client, filter)); }
public OkHttpsURLConnection(URL url, OkHttpClient client) { this(new OkHttpURLConnection(url, client)); }
HttpURLConnection open(URL url, @Nullable Proxy proxy) { String protocol = url.getProtocol(); OkHttpClient copy = client.newBuilder() .proxy(proxy) .build(); if (protocol.equals("http")) return new OkHttpURLConnection(url, copy, urlFilter); if (protocol.equals("https")) return new OkHttpsURLConnection(url, copy, urlFilter); throw new IllegalArgumentException("Unexpected protocol: " + protocol); }
/** * Open url. * * @param url {@link URL}. * @param proxy {@link Proxy}. * @return {@link HttpURLConnection}. */ public HttpURLConnection open(URL url, Proxy proxy) { OkHttpClient copy = mClient.newBuilder().proxy(proxy).build(); String protocol = url.getProtocol(); if (protocol.equals("http")) return new OkHttpURLConnection(url, copy); if (protocol.equals("https")) return new OkHttpsURLConnection(url, copy); throw new IllegalArgumentException("Unexpected protocol: " + protocol); } }
public OkHttpsURLConnection(URL url, OkHttpClient client, URLFilter filter) { this(new OkHttpURLConnection(url, client, filter)); }
public OkHttpsURLConnection(URL url, OkHttpClient client) { this(new OkHttpURLConnection(url, client)); }
public OkHttpsURLConnection(URL url, OkHttpClient client) { this(new OkHttpURLConnection(url, client)); }
public OkHttpsURLConnection(URL url, OkHttpClient client) { this(new OkHttpURLConnection(url, client)); }
public OkHttpsURLConnection(URL url, OkHttpClient client, URLFilter filter) { this(new OkHttpURLConnection(url, client, filter)); }
public OkHttpsURLConnection(URL url, OkHttpClient client, URLFilter filter) { this(new OkHttpURLConnection(url, client, filter)); }
private HttpURLConnection open(URL url, Proxy proxy) { OkHttpClient newClient = mClient.newBuilder().proxy(proxy).build(); String protocol = url.getProtocol(); if (protocol.equalsIgnoreCase("http")) return new OkHttpURLConnection(url, newClient); if (protocol.equalsIgnoreCase("https")) return new OkHttpsURLConnection(url, newClient); throw new IllegalArgumentException("Unexpected protocol: " + protocol); }
HttpURLConnection open(URL url, Proxy proxy) { String protocol = url.getProtocol(); OkHttpClient copy = client.newBuilder() .proxy(proxy) .build(); if (protocol.equals("http")) return new OkHttpURLConnection(url, copy, urlFilter); if (protocol.equals("https")) return new OkHttpsURLConnection(url, copy, urlFilter); throw new IllegalArgumentException("Unexpected protocol: " + protocol); }
HttpURLConnection open(URL url, Proxy proxy) { String protocol = url.getProtocol(); OkHttpClient copy = client.newBuilder() .proxy(proxy) .build(); if (protocol.equals("http")) return new OkHttpURLConnection(url, copy, urlFilter); if (protocol.equals("https")) return new OkHttpsURLConnection(url, copy, urlFilter); throw new IllegalArgumentException("Unexpected protocol: " + protocol); }
HttpURLConnection open(URL url, @Nullable Proxy proxy) { String protocol = url.getProtocol(); OkHttpClient copy = client.newBuilder() .proxy(proxy) .build(); if (protocol.equals("http")) return new OkHttpURLConnection(url, copy, urlFilter); if (protocol.equals("https")) return new OkHttpsURLConnection(url, copy, urlFilter); throw new IllegalArgumentException("Unexpected protocol: " + protocol); }