导航菜单

页面标题

页面副标题

Life Church v15.20.21 - RaygunHttpUrlConnection.java 源代码

正在查看: Life Church v15.20.21 应用的 RaygunHttpUrlConnection.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package main.java.com.mindscapehq.android.raygun4android.network.http;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.ProtocolException;
import java.net.URL;
import java.net.URLConnection;
import java.security.Permission;
import java.util.List;
import java.util.Map;
import main.java.com.mindscapehq.android.raygun4android.network.RaygunNetworkLogger;
import main.java.com.mindscapehq.android.raygun4android.network.RaygunNetworkUtils;

public final class RaygunHttpUrlConnection extends HttpURLConnection {
    private URLConnection connectionInstance;

    public RaygunHttpUrlConnection(URLConnection uRLConnection) {
        super(uRLConnection.getURL());
        this.connectionInstance = uRLConnection;
        RaygunNetworkLogger.startNetworkCall(uRLConnection.getURL().toExternalForm(), System.currentTimeMillis());
    }

    @Override
    public void connect() throws IOException {
        try {
            this.connectionInstance.connect();
        } catch (IOException e) {
            RaygunNetworkLogger.cancelNetworkCall(this.url.toExternalForm(), getRequestMethod(), System.currentTimeMillis(), e.getMessage());
            throw e;
        }
    }

    @Override
    public void disconnect() {
        RaygunNetworkLogger.endNetworkCall(this.url.toExternalForm(), getRequestMethod(), System.currentTimeMillis(), RaygunNetworkUtils.getStatusCode(this.connectionInstance));
        URLConnection uRLConnection = this.connectionInstance;
        if (uRLConnection instanceof HttpURLConnection) {
            ((HttpURLConnection) uRLConnection).disconnect();
        }
    }

    @Override
    public InputStream getInputStream() throws IOException {
        try {
            return this.connectionInstance.getInputStream();
        } catch (IOException e) {
            RaygunNetworkLogger.cancelNetworkCall(this.url.toExternalForm(), getRequestMethod(), System.currentTimeMillis(), e.getMessage());
            throw e;
        }
    }

    @Override
    public OutputStream getOutputStream() throws IOException {
        try {
            return this.connectionInstance.getOutputStream();
        } catch (IOException e) {
            RaygunNetworkLogger.cancelNetworkCall(this.url.toExternalForm(), getRequestMethod(), System.currentTimeMillis(), e.getMessage());
            throw e;
        }
    }

    @Override
    public boolean getAllowUserInteraction() {
        return this.connectionInstance.getAllowUserInteraction();
    }

    @Override
    public void addRequestProperty(String str, String str2) {
        this.connectionInstance.addRequestProperty(str, str2);
    }

    @Override
    public int getConnectTimeout() {
        return this.connectionInstance.getConnectTimeout();
    }

    @Override
    public Object getContent() throws IOException {
        try {
            return this.connectionInstance.getContent();
        } catch (IOException e) {
            RaygunNetworkLogger.cancelNetworkCall(this.url.toExternalForm(), getRequestMethod(), System.currentTimeMillis(), e.getMessage());
            throw e;
        }
    }

    @Override
    public Object getContent(Class[] clsArr) throws IOException {
        try {
            return this.connectionInstance.getContent(clsArr);
        } catch (IOException e) {
            RaygunNetworkLogger.cancelNetworkCall(this.url.toExternalForm(), getRequestMethod(), System.currentTimeMillis(), e.getMessage());
            throw e;
        }
    }

    @Override
    public String getContentEncoding() {
        return this.connectionInstance.getContentEncoding();
    }

    @Override
    public int getContentLength() {
        return this.connectionInstance.getContentLength();
    }

    @Override
    public String getContentType() {
        return this.connectionInstance.getContentType();
    }

    @Override
    public long getDate() {
        return this.connectionInstance.getDate();
    }

    @Override
    public boolean getDefaultUseCaches() {
        return this.connectionInstance.getDefaultUseCaches();
    }

    @Override
    public boolean getDoInput() {
        return this.connectionInstance.getDoInput();
    }

    @Override
    public boolean getDoOutput() {
        return this.connectionInstance.getDoOutput();
    }

    @Override
    public long getExpiration() {
        return this.connectionInstance.getExpiration();
    }

    @Override
    public String getHeaderField(int i) {
        return this.connectionInstance.getHeaderField(i);
    }

    @Override
    public String getHeaderField(String str) {
        return this.connectionInstance.getHeaderField(str);
    }

    @Override
    public long getHeaderFieldDate(String str, long j) {
        return this.connectionInstance.getHeaderFieldDate(str, j);
    }

    @Override
    public int getHeaderFieldInt(String str, int i) {
        return this.connectionInstance.getHeaderFieldInt(str, i);
    }

    @Override
    public String getHeaderFieldKey(int i) {
        return this.connectionInstance.getHeaderFieldKey(i);
    }

    @Override
    public Map<String, List<String>> getHeaderFields() {
        return this.connectionInstance.getHeaderFields();
    }

    @Override
    public long getIfModifiedSince() {
        return this.connectionInstance.getIfModifiedSince();
    }

    @Override
    public long getLastModified() {
        return this.connectionInstance.getLastModified();
    }

    @Override
    public Permission getPermission() throws IOException {
        try {
            return this.connectionInstance.getPermission();
        } catch (IOException e) {
            RaygunNetworkLogger.cancelNetworkCall(this.url.toExternalForm(), getRequestMethod(), System.currentTimeMillis(), e.getMessage());
            throw e;
        }
    }

    @Override
    public int getReadTimeout() {
        return this.connectionInstance.getReadTimeout();
    }

    @Override
    public Map<String, List<String>> getRequestProperties() {
        return this.connectionInstance.getRequestProperties();
    }

    @Override
    public String getRequestProperty(String str) {
        return this.connectionInstance.getRequestProperty(str);
    }

    @Override
    public URL getURL() {
        return this.connectionInstance.getURL();
    }

    @Override
    public boolean getUseCaches() {
        return this.connectionInstance.getUseCaches();
    }

    @Override
    public void setAllowUserInteraction(boolean z) {
        this.connectionInstance.setAllowUserInteraction(z);
    }

    @Override
    public void setConnectTimeout(int i) {
        this.connectionInstance.setConnectTimeout(i);
    }

    @Override
    public void setDefaultUseCaches(boolean z) {
        this.connectionInstance.setDefaultUseCaches(z);
    }

    @Override
    public void setDoInput(boolean z) {
        this.connectionInstance.setDoInput(z);
    }

    @Override
    public void setDoOutput(boolean z) {
        this.connectionInstance.setDoOutput(z);
    }

    @Override
    public void setIfModifiedSince(long j) {
        this.connectionInstance.setIfModifiedSince(j);
    }

    @Override
    public void setReadTimeout(int i) {
        this.connectionInstance.setReadTimeout(i);
    }

    @Override
    public void setRequestProperty(String str, String str2) {
        this.connectionInstance.setRequestProperty(str, str2);
    }

    @Override
    public void setUseCaches(boolean z) {
        this.connectionInstance.setUseCaches(z);
    }

    @Override
    public boolean usingProxy() {
        URLConnection uRLConnection = this.connectionInstance;
        if (uRLConnection instanceof HttpURLConnection) {
            return ((HttpURLConnection) uRLConnection).usingProxy();
        }
        return false;
    }

    @Override
    public InputStream getErrorStream() {
        URLConnection uRLConnection = this.connectionInstance;
        if (uRLConnection instanceof HttpURLConnection) {
            return ((HttpURLConnection) uRLConnection).getErrorStream();
        }
        return null;
    }

    @Override
    public boolean getInstanceFollowRedirects() {
        URLConnection uRLConnection = this.connectionInstance;
        if (uRLConnection instanceof HttpURLConnection) {
            return ((HttpURLConnection) uRLConnection).getInstanceFollowRedirects();
        }
        return true;
    }

    @Override
    public String getRequestMethod() {
        URLConnection uRLConnection = this.connectionInstance;
        return uRLConnection instanceof HttpURLConnection ? ((HttpURLConnection) uRLConnection).getRequestMethod() : "GET";
    }

    @Override
    public int getResponseCode() throws IOException {
        URLConnection uRLConnection = this.connectionInstance;
        if (uRLConnection instanceof HttpURLConnection) {
            return ((HttpURLConnection) uRLConnection).getResponseCode();
        }
        return -1;
    }

    @Override
    public String getResponseMessage() throws IOException {
        URLConnection uRLConnection = this.connectionInstance;
        return uRLConnection instanceof HttpURLConnection ? ((HttpURLConnection) uRLConnection).getResponseMessage() : "";
    }

    @Override
    public void setChunkedStreamingMode(int i) {
        URLConnection uRLConnection = this.connectionInstance;
        if (uRLConnection instanceof HttpURLConnection) {
            ((HttpURLConnection) uRLConnection).setChunkedStreamingMode(i);
        }
    }

    @Override
    public void setFixedLengthStreamingMode(int i) {
        URLConnection uRLConnection = this.connectionInstance;
        if (uRLConnection instanceof HttpURLConnection) {
            ((HttpURLConnection) uRLConnection).setFixedLengthStreamingMode(i);
        }
    }

    @Override
    public void setInstanceFollowRedirects(boolean z) {
        URLConnection uRLConnection = this.connectionInstance;
        if (uRLConnection instanceof HttpURLConnection) {
            ((HttpURLConnection) uRLConnection).setInstanceFollowRedirects(z);
        }
    }

    @Override
    public void setRequestMethod(String str) throws ProtocolException {
        URLConnection uRLConnection = this.connectionInstance;
        if (uRLConnection instanceof HttpURLConnection) {
            ((HttpURLConnection) uRLConnection).setRequestMethod(str);
        }
    }
}