Перенос с маленькими правками
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
package com.ea.nimble;
|
||||
|
||||
import com.ea.nimble.IHttpRequest;
|
||||
import com.ea.nimble.Log;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.net.URL;
|
||||
import java.util.HashMap;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class HttpRequest implements IHttpRequest {
|
||||
private static int DEFAULT_NETWORK_TIMEOUT = 30;
|
||||
public ByteArrayOutputStream data;
|
||||
public HashMap<String, String> headers;
|
||||
public IHttpRequest.Method method;
|
||||
public boolean runInBackground;
|
||||
public String targetFilePath;
|
||||
public double timeout;
|
||||
public URL url;
|
||||
|
||||
public HttpRequest() {
|
||||
this.url = null;
|
||||
this.method = IHttpRequest.Method.GET;
|
||||
this.data = new ByteArrayOutputStream();
|
||||
this.headers = new HashMap<>();
|
||||
this.timeout = DEFAULT_NETWORK_TIMEOUT;
|
||||
this.targetFilePath = null;
|
||||
}
|
||||
|
||||
public HttpRequest(URL url) {
|
||||
this();
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IHttpRequest
|
||||
public URL getUrl() {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
return this.url;
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IHttpRequest
|
||||
public IHttpRequest.Method getMethod() {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
return this.method;
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IHttpRequest
|
||||
public byte[] getData() {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
return this.data.toByteArray();
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IHttpRequest
|
||||
public HashMap<String, String> getHeaders() {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
return this.headers;
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IHttpRequest
|
||||
public double getTimeout() {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
return this.timeout;
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IHttpRequest
|
||||
public String getTargetFilePath() {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
return this.targetFilePath;
|
||||
}
|
||||
|
||||
@Override // com.ea.nimble.IHttpRequest
|
||||
public boolean getRunInBackground() {
|
||||
Log.Helper.LOGPUBLICFUNC(this);
|
||||
return this.runInBackground;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user