- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
92 lines
2.4 KiB
Java
92 lines
2.4 KiB
Java
package com.amazonaws.http;
|
|
|
|
import java.io.InputStream;
|
|
import java.util.Collections;
|
|
import java.util.HashMap;
|
|
import java.util.Map;
|
|
import java.util.zip.GZIPInputStream;
|
|
import org.apache.http.protocol.HTTP;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class HttpResponse {
|
|
public InputStream content;
|
|
public final Map headers;
|
|
public final InputStream rawContent;
|
|
public final int statusCode;
|
|
public final String statusText;
|
|
|
|
public Map getHeaders() {
|
|
return this.headers;
|
|
}
|
|
|
|
public InputStream getRawContent() {
|
|
return this.rawContent;
|
|
}
|
|
|
|
public int getStatusCode() {
|
|
return this.statusCode;
|
|
}
|
|
|
|
public String getStatusText() {
|
|
return this.statusText;
|
|
}
|
|
|
|
public HttpResponse(String str, int i, Map map, InputStream inputStream) {
|
|
this.statusText = str;
|
|
this.statusCode = i;
|
|
this.headers = map;
|
|
this.rawContent = inputStream;
|
|
}
|
|
|
|
public InputStream getContent() {
|
|
if (this.content == null) {
|
|
synchronized (this) {
|
|
try {
|
|
if (this.rawContent == null || !"gzip".equals(this.headers.get(HTTP.CONTENT_ENCODING))) {
|
|
this.content = this.rawContent;
|
|
} else {
|
|
this.content = new GZIPInputStream(this.rawContent);
|
|
}
|
|
} finally {
|
|
}
|
|
}
|
|
}
|
|
return this.content;
|
|
}
|
|
|
|
public static Builder builder() {
|
|
return new Builder();
|
|
}
|
|
|
|
public static class Builder {
|
|
public InputStream content;
|
|
public final Map headers = new HashMap();
|
|
public int statusCode;
|
|
public String statusText;
|
|
|
|
public Builder content(InputStream inputStream) {
|
|
this.content = inputStream;
|
|
return this;
|
|
}
|
|
|
|
public Builder statusCode(int i) {
|
|
this.statusCode = i;
|
|
return this;
|
|
}
|
|
|
|
public Builder statusText(String str) {
|
|
this.statusText = str;
|
|
return this;
|
|
}
|
|
|
|
public Builder header(String str, String str2) {
|
|
this.headers.put(str, str2);
|
|
return this;
|
|
}
|
|
|
|
public HttpResponse build() {
|
|
return new HttpResponse(this.statusText, this.statusCode, Collections.unmodifiableMap(this.headers), this.content);
|
|
}
|
|
}
|
|
}
|