88 lines
2.6 KiB
Java
88 lines
2.6 KiB
Java
|
package o;
|
||
|
|
||
|
import java.io.IOException;
|
||
|
import java.io.InputStream;
|
||
|
import java.io.OutputStream;
|
||
|
import java.net.HttpURLConnection;
|
||
|
import java.net.Proxy;
|
||
|
import java.net.URL;
|
||
|
import java.util.LinkedList;
|
||
|
import java.util.List;
|
||
|
import java.util.Map;
|
||
|
|
||
|
/* renamed from: o.gnc, reason: case insensitive filesystem */
|
||
|
/* loaded from: classes6.dex */
|
||
|
public final class C15327gnc implements InterfaceC15325gna {
|
||
|
private HttpURLConnection b;
|
||
|
|
||
|
public C15327gnc(Proxy proxy, String str, int i) throws IOException {
|
||
|
HttpURLConnection httpURLConnection;
|
||
|
if (proxy == null) {
|
||
|
httpURLConnection = (HttpURLConnection) new URL(str).openConnection();
|
||
|
} else {
|
||
|
httpURLConnection = (HttpURLConnection) new URL(str).openConnection(proxy);
|
||
|
}
|
||
|
this.b = httpURLConnection;
|
||
|
httpURLConnection.setUseCaches(false);
|
||
|
this.b.setDoOutput(true);
|
||
|
this.b.setDoInput(true);
|
||
|
this.b.setConnectTimeout(i);
|
||
|
this.b.setReadTimeout(i);
|
||
|
}
|
||
|
|
||
|
@Override // o.InterfaceC15325gna
|
||
|
public final void a() {
|
||
|
this.b.disconnect();
|
||
|
}
|
||
|
|
||
|
@Override // o.InterfaceC15325gna
|
||
|
public final List e() throws IOException {
|
||
|
LinkedList linkedList = new LinkedList();
|
||
|
Map<String, List<String>> headerFields = this.b.getHeaderFields();
|
||
|
if (headerFields != null) {
|
||
|
for (String str : headerFields.keySet()) {
|
||
|
List<String> list = headerFields.get(str);
|
||
|
for (int i = 0; i < list.size(); i++) {
|
||
|
linkedList.add(new gmE(str, list.get(i)));
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
return linkedList;
|
||
|
}
|
||
|
|
||
|
@Override // o.InterfaceC15325gna
|
||
|
public final int c() throws IOException {
|
||
|
return this.b.getResponseCode();
|
||
|
}
|
||
|
|
||
|
@Override // o.InterfaceC15325gna
|
||
|
public final void c(String str, String str2) {
|
||
|
this.b.setRequestProperty(str, str2);
|
||
|
}
|
||
|
|
||
|
@Override // o.InterfaceC15325gna
|
||
|
public final void b(String str) throws IOException {
|
||
|
this.b.setRequestMethod(str);
|
||
|
}
|
||
|
|
||
|
@Override // o.InterfaceC15325gna
|
||
|
public final void b(int i) {
|
||
|
this.b.setFixedLengthStreamingMode(i);
|
||
|
}
|
||
|
|
||
|
@Override // o.InterfaceC15325gna
|
||
|
public final OutputStream h() throws IOException {
|
||
|
return this.b.getOutputStream();
|
||
|
}
|
||
|
|
||
|
@Override // o.InterfaceC15325gna
|
||
|
public final InputStream b() throws IOException {
|
||
|
return this.b.getInputStream();
|
||
|
}
|
||
|
|
||
|
@Override // o.InterfaceC15325gna
|
||
|
public final InputStream d() {
|
||
|
return this.b.getErrorStream();
|
||
|
}
|
||
|
}
|