293 lines
8.9 KiB
Java
293 lines
8.9 KiB
Java
package com.google.android.gms.internal.firebase_ml;
|
|
|
|
import com.google.android.gms.internal.firebase_ml.zzhm;
|
|
import com.google.common.net.HttpHeaders;
|
|
import java.io.IOException;
|
|
import java.io.Writer;
|
|
import java.lang.reflect.Type;
|
|
import java.util.ArrayList;
|
|
import java.util.Collection;
|
|
import java.util.Collections;
|
|
import java.util.EnumSet;
|
|
import java.util.HashSet;
|
|
import java.util.Iterator;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.logging.Level;
|
|
import java.util.logging.Logger;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public final class zzfe extends zzhm {
|
|
|
|
@zzho("Accept")
|
|
private List<String> accept;
|
|
|
|
@zzho(HttpHeaders.ACCEPT_ENCODING)
|
|
private List<String> acceptEncoding;
|
|
|
|
@zzho(HttpHeaders.AGE)
|
|
private List<Long> age;
|
|
|
|
@zzho(HttpHeaders.WWW_AUTHENTICATE)
|
|
private List<String> authenticate;
|
|
|
|
@zzho(HttpHeaders.AUTHORIZATION)
|
|
private List<String> authorization;
|
|
|
|
@zzho(HttpHeaders.CACHE_CONTROL)
|
|
private List<String> cacheControl;
|
|
|
|
@zzho(HttpHeaders.CONTENT_ENCODING)
|
|
private List<String> contentEncoding;
|
|
|
|
@zzho(HttpHeaders.CONTENT_LENGTH)
|
|
private List<Long> contentLength;
|
|
|
|
@zzho(HttpHeaders.CONTENT_MD5)
|
|
private List<String> contentMD5;
|
|
|
|
@zzho(HttpHeaders.CONTENT_RANGE)
|
|
private List<String> contentRange;
|
|
|
|
@zzho(HttpHeaders.CONTENT_TYPE)
|
|
private List<String> contentType;
|
|
|
|
@zzho(HttpHeaders.COOKIE)
|
|
private List<String> cookie;
|
|
|
|
@zzho(HttpHeaders.DATE)
|
|
private List<String> date;
|
|
|
|
@zzho(HttpHeaders.ETAG)
|
|
private List<String> etag;
|
|
|
|
@zzho(HttpHeaders.EXPIRES)
|
|
private List<String> expires;
|
|
|
|
@zzho(HttpHeaders.IF_MATCH)
|
|
private List<String> ifMatch;
|
|
|
|
@zzho(HttpHeaders.IF_MODIFIED_SINCE)
|
|
private List<String> ifModifiedSince;
|
|
|
|
@zzho(HttpHeaders.IF_NONE_MATCH)
|
|
private List<String> ifNoneMatch;
|
|
|
|
@zzho(HttpHeaders.IF_RANGE)
|
|
private List<String> ifRange;
|
|
|
|
@zzho(HttpHeaders.IF_UNMODIFIED_SINCE)
|
|
private List<String> ifUnmodifiedSince;
|
|
|
|
@zzho(HttpHeaders.LAST_MODIFIED)
|
|
private List<String> lastModified;
|
|
|
|
@zzho(HttpHeaders.LOCATION)
|
|
private List<String> location;
|
|
|
|
@zzho("MIME-Version")
|
|
private List<String> mimeVersion;
|
|
|
|
@zzho(HttpHeaders.RANGE)
|
|
private List<String> range;
|
|
|
|
@zzho(HttpHeaders.RETRY_AFTER)
|
|
private List<String> retryAfter;
|
|
|
|
@zzho("User-Agent")
|
|
private List<String> userAgent;
|
|
|
|
public zzfe() {
|
|
super(EnumSet.of(zzhm.zzc.IGNORE_CASE));
|
|
this.acceptEncoding = new ArrayList(Collections.singleton("gzip"));
|
|
}
|
|
|
|
public final zzfe zzy(String str) {
|
|
this.authorization = zza((Object) null);
|
|
return this;
|
|
}
|
|
|
|
public final String getContentType() {
|
|
return (String) zza((List) this.contentType);
|
|
}
|
|
|
|
public final zzfe zzz(String str) {
|
|
this.ifModifiedSince = zza((Object) null);
|
|
return this;
|
|
}
|
|
|
|
public final zzfe zzaa(String str) {
|
|
this.ifMatch = zza((Object) null);
|
|
return this;
|
|
}
|
|
|
|
public final zzfe zzab(String str) {
|
|
this.ifNoneMatch = zza((Object) null);
|
|
return this;
|
|
}
|
|
|
|
public final zzfe zzac(String str) {
|
|
this.ifUnmodifiedSince = zza((Object) null);
|
|
return this;
|
|
}
|
|
|
|
public final zzfe zzad(String str) {
|
|
this.ifRange = zza((Object) null);
|
|
return this;
|
|
}
|
|
|
|
public final String getLocation() {
|
|
return (String) zza((List) this.location);
|
|
}
|
|
|
|
public final String zzex() {
|
|
return (String) zza((List) this.userAgent);
|
|
}
|
|
|
|
public final zzfe zzae(String str) {
|
|
this.userAgent = zza(str);
|
|
return this;
|
|
}
|
|
|
|
private static void zza(Logger logger, StringBuilder sb, StringBuilder sb2, zzfp zzfpVar, String str, Object obj, Writer writer) throws IOException {
|
|
if (obj == null || zzhf.isNull(obj)) {
|
|
return;
|
|
}
|
|
String name = obj instanceof Enum ? zzhl.zza((Enum<?>) obj).getName() : obj.toString();
|
|
String str2 = ((HttpHeaders.AUTHORIZATION.equalsIgnoreCase(str) || HttpHeaders.COOKIE.equalsIgnoreCase(str)) && (logger == null || !logger.isLoggable(Level.ALL))) ? "<Not Logged>" : name;
|
|
if (sb != null) {
|
|
sb.append(str);
|
|
sb.append(": ");
|
|
sb.append(str2);
|
|
sb.append(zzhz.zzaae);
|
|
}
|
|
if (sb2 != null) {
|
|
sb2.append(" -H '");
|
|
sb2.append(str);
|
|
sb2.append(": ");
|
|
sb2.append(str2);
|
|
sb2.append("'");
|
|
}
|
|
if (zzfpVar != null) {
|
|
zzfpVar.addHeader(str, name);
|
|
}
|
|
if (writer != null) {
|
|
writer.write(str);
|
|
writer.write(": ");
|
|
writer.write(name);
|
|
writer.write("\r\n");
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public static void zza(zzfe zzfeVar, StringBuilder sb, StringBuilder sb2, Logger logger, zzfp zzfpVar) throws IOException {
|
|
HashSet hashSet = new HashSet();
|
|
for (Map.Entry<String, Object> entry : zzfeVar.entrySet()) {
|
|
String key = entry.getKey();
|
|
Object[] objArr = {key};
|
|
if (!hashSet.add(key)) {
|
|
throw new IllegalArgumentException(zzla.zzb("multiple headers of the same name (headers are case insensitive): %s", objArr));
|
|
}
|
|
Object value = entry.getValue();
|
|
if (value != null) {
|
|
zzhl zzao = zzfeVar.zzhi().zzao(key);
|
|
if (zzao != null) {
|
|
key = zzao.getName();
|
|
}
|
|
Class<?> cls = value.getClass();
|
|
if ((value instanceof Iterable) || cls.isArray()) {
|
|
Iterator it = zzia.zzi(value).iterator();
|
|
while (it.hasNext()) {
|
|
zza(logger, sb, sb2, zzfpVar, key, it.next(), null);
|
|
}
|
|
} else {
|
|
zza(logger, sb, sb2, zzfpVar, key, value, null);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
public final void zza(zzfq zzfqVar, StringBuilder sb) throws IOException {
|
|
clear();
|
|
zzff zzffVar = new zzff(this, sb);
|
|
int zzfq = zzfqVar.zzfq();
|
|
for (int i = 0; i < zzfq; i++) {
|
|
String zzab = zzfqVar.zzab(i);
|
|
String zzac = zzfqVar.zzac(i);
|
|
List<Type> list = zzffVar.zzty;
|
|
zzhd zzhdVar = zzffVar.zztx;
|
|
zzgy zzgyVar = zzffVar.zztv;
|
|
StringBuilder sb2 = zzffVar.zztw;
|
|
if (sb2 != null) {
|
|
StringBuilder sb3 = new StringBuilder(String.valueOf(zzab).length() + 2 + String.valueOf(zzac).length());
|
|
sb3.append(zzab);
|
|
sb3.append(": ");
|
|
sb3.append(zzac);
|
|
sb2.append(sb3.toString());
|
|
sb2.append(zzhz.zzaae);
|
|
}
|
|
zzhl zzao = zzhdVar.zzao(zzab);
|
|
if (zzao != null) {
|
|
Type zza = zzhf.zza(list, zzao.getGenericType());
|
|
if (zzia.zzc(zza)) {
|
|
Class<?> zzb = zzia.zzb(list, zzia.zzd(zza));
|
|
zzgyVar.zza(zzao.zzhf(), zzb, zza(zzb, list, zzac));
|
|
} else if (zzia.zza(zzia.zzb(list, zza), (Class<?>) Iterable.class)) {
|
|
Collection<Object> collection = (Collection) zzao.zzh(this);
|
|
if (collection == null) {
|
|
collection = zzhf.zzb(zza);
|
|
zzao.zzb(this, collection);
|
|
}
|
|
collection.add(zza(zza == Object.class ? null : zzia.zze(zza), list, zzac));
|
|
} else {
|
|
zzao.zzb(this, zza(zza, list, zzac));
|
|
}
|
|
} else {
|
|
ArrayList arrayList = (ArrayList) get(zzab);
|
|
if (arrayList == null) {
|
|
arrayList = new ArrayList();
|
|
zzb(zzab, arrayList);
|
|
}
|
|
arrayList.add(zzac);
|
|
}
|
|
}
|
|
zzffVar.zztv.zzha();
|
|
}
|
|
|
|
private static <T> T zza(List<T> list) {
|
|
if (list == null) {
|
|
return null;
|
|
}
|
|
return list.get(0);
|
|
}
|
|
|
|
private static <T> List<T> zza(T t) {
|
|
if (t == null) {
|
|
return null;
|
|
}
|
|
ArrayList arrayList = new ArrayList();
|
|
arrayList.add(t);
|
|
return arrayList;
|
|
}
|
|
|
|
private static Object zza(Type type, List<Type> list, String str) {
|
|
return zzhf.zza(zzhf.zza(list, type), str);
|
|
}
|
|
|
|
@Override // com.google.android.gms.internal.firebase_ml.zzhm
|
|
/* renamed from: zzeh */
|
|
public final /* synthetic */ zzhm clone() {
|
|
return (zzfe) clone();
|
|
}
|
|
|
|
@Override // com.google.android.gms.internal.firebase_ml.zzhm
|
|
public final /* synthetic */ zzhm zzb(String str, Object obj) {
|
|
return (zzfe) super.zzb(str, obj);
|
|
}
|
|
|
|
@Override // com.google.android.gms.internal.firebase_ml.zzhm, java.util.AbstractMap
|
|
public final /* synthetic */ Object clone() throws CloneNotSupportedException {
|
|
return (zzfe) super.clone();
|
|
}
|
|
}
|