// Path: framework/src/main/java/com/kifile/android/cornerstone/core/ConvertException.java
// public class ConvertException extends Exception {
// 
//     private Object o;
// 
//     public ConvertException() {
//     }
// 
//     public ConvertException(String detailMessage) {
//         super(detailMessage);
//     }
// 
//     public ConvertException(String detailMessage, Throwable throwable) {
//         super(detailMessage, throwable);
//     }
// 
//     public ConvertException(Throwable throwable) {
//         super(throwable);
//     }
// 
//     public void setError(Object error) {
//         o = error;
//     }
// 
//     public Object getError() {
//         return o;
//     }
// }
// 
// Path: framework/src/main/java/com/kifile/android/cornerstone/core/DataFetcher.java
// public interface DataFetcher<DATA> {
// 
//     /**
//      * Fetch data.
//      *
//      * @return If fetch successful, return the data.
//      * @throws FetchException   Throw FetchException when you cannot fetch a data.
//      * @throws ConvertException Throw ConvertException when you cannot convert the data to another type.
//      */
//     DATA fetch() throws FetchException, ConvertException;
// }
// 
// Path: framework/src/main/java/com/kifile/android/cornerstone/core/FetchException.java
// public class FetchException extends Exception {
// 
//     public FetchException() {
//     }
// 
//     public FetchException(String detailMessage) {
//         super(detailMessage);
//     }
// 
//     public FetchException(String detailMessage, Throwable throwable) {
//         super(detailMessage, throwable);
//     }
// 
//     public FetchException(Throwable throwable) {
//         super(throwable);
//     }
// }
// 
// Path: framework/src/main/java/com/kifile/android/cornerstone/utils/HttpUtils.java
// public class HttpUtils {
// 
//     private static final OkHttpClient sClient = new OkHttpClient();
// 
//     static {
//         // 设置连接 5 秒超时.
//         sClient.setWriteTimeout(5, TimeUnit.SECONDS);
//         sClient.setConnectTimeout(5, TimeUnit.SECONDS);
//         sClient.setReadTimeout(5, TimeUnit.SECONDS);
//     }
// 
//     /**
//      * 执行Request命令.
//      *
//      * @param request
//      * @return
//      * @throws IOException
//      */
//     public static Response getResponse(Request request) throws IOException {
//         return sClient.newCall(request).execute();
//     }
// 
//     public static OkHttpClient getClient() {
//         return sClient;
//     }
// }


import android.util.Log;
import com.kifile.android.cornerstone.core.ConvertException;
import com.kifile.android.cornerstone.core.DataFetcher;
import com.kifile.android.cornerstone.core.FetchException;
import com.kifile.android.cornerstone.utils.HttpUtils;
import com.squareup.okhttp.FormEncodingBuilder;
import com.squareup.okhttp.Headers;
import com.squareup.okhttp.MediaType;
import com.squareup.okhttp.MultipartBuilder;
import com.squareup.okhttp.Request;
import com.squareup.okhttp.RequestBody;
import com.squareup.okhttp.Response;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.File;
import java.io.IOException;
import java.util.Map;
            }
            case METHOD_GET: {
                String url = appendParams(mUrl, mParams);
                requestBuilder = new Request.Builder().url(url).get();
                break;
            }
            case METHOD_POST: {
                requestBuilder = new Request.Builder().url(mUrl).post(getRequestBody(mParams, mFileParams));
                break;
            }
            case METHOD_DELETE: {
                requestBuilder = new Request.Builder().url(mUrl).delete(getRequestBody(mParams, mFileParams));
                break;
            }
            case METHOD_PUT: {
                requestBuilder = new Request.Builder().url(mUrl).put(getRequestBody(mParams, mFileParams));
                break;
            }
            case METHOD_PATCH: {
                requestBuilder = new Request.Builder().url(mUrl).patch(getRequestBody(mParams, mFileParams));
                break;
            }
            default:
                throw new IllegalArgumentException("Unsupported method:" + mMethod);
        }
        if (requestBuilder != null) {
            try {
                if (mHttpHeader != null) {
                    requestBuilder.headers(mHttpHeader);
                }
// Path: framework/src/main/java/com/kifile/android/cornerstone/core/ConvertException.java
// public class ConvertException extends Exception {
// 
//     private Object o;
// 
//     public ConvertException() {
//     }
// 
//     public ConvertException(String detailMessage) {
//         super(detailMessage);
//     }
// 
//     public ConvertException(String detailMessage, Throwable throwable) {
//         super(detailMessage, throwable);
//     }
// 
//     public ConvertException(Throwable throwable) {
//         super(throwable);
//     }
// 
//     public void setError(Object error) {
//         o = error;
//     }
// 
//     public Object getError() {
//         return o;
//     }
// }
// 
// Path: framework/src/main/java/com/kifile/android/cornerstone/core/DataFetcher.java
// public interface DataFetcher<DATA> {
// 
//     /**
//      * Fetch data.
//      *
//      * @return If fetch successful, return the data.
//      * @throws FetchException   Throw FetchException when you cannot fetch a data.
//      * @throws ConvertException Throw ConvertException when you cannot convert the data to another type.
//      */
//     DATA fetch() throws FetchException, ConvertException;
// }
// 
// Path: framework/src/main/java/com/kifile/android/cornerstone/core/FetchException.java
// public class FetchException extends Exception {
// 
//     public FetchException() {
//     }
// 
//     public FetchException(String detailMessage) {
//         super(detailMessage);
//     }
// 
//     public FetchException(String detailMessage, Throwable throwable) {
//         super(detailMessage, throwable);
//     }
// 
//     public FetchException(Throwable throwable) {
//         super(throwable);
//     }
// }
// 
// Path: framework/src/main/java/com/kifile/android/cornerstone/utils/HttpUtils.java
// public class HttpUtils {
// 
//     private static final OkHttpClient sClient = new OkHttpClient();
// 
//     static {
//         // 设置连接 5 秒超时.
//         sClient.setWriteTimeout(5, TimeUnit.SECONDS);
//         sClient.setConnectTimeout(5, TimeUnit.SECONDS);
//         sClient.setReadTimeout(5, TimeUnit.SECONDS);
//     }
// 
//     /**
//      * 执行Request命令.
//      *
//      * @param request
//      * @return
//      * @throws IOException
//      */
//     public static Response getResponse(Request request) throws IOException {
//         return sClient.newCall(request).execute();
//     }
// 
//     public static OkHttpClient getClient() {
//         return sClient;
//     }
// }


// Path: framework/src/main/java/com/kifile/android/cornerstone/impl/fetchers/HttpFetcher.java
import android.util.Log;
import com.kifile.android.cornerstone.core.ConvertException;
import com.kifile.android.cornerstone.core.DataFetcher;
import com.kifile.android.cornerstone.core.FetchException;
import com.kifile.android.cornerstone.utils.HttpUtils;
import com.squareup.okhttp.FormEncodingBuilder;
import com.squareup.okhttp.Headers;
import com.squareup.okhttp.MediaType;
import com.squareup.okhttp.MultipartBuilder;
import com.squareup.okhttp.Request;
import com.squareup.okhttp.RequestBody;
import com.squareup.okhttp.Response;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.File;
import java.io.IOException;
import java.util.Map;

            }
            case METHOD_GET: {
                String url = appendParams(mUrl, mParams);
                requestBuilder = new Request.Builder().url(url).get();
                break;
            }
            case METHOD_POST: {
                requestBuilder = new Request.Builder().url(mUrl).post(getRequestBody(mParams, mFileParams));
                break;
            }
            case METHOD_DELETE: {
                requestBuilder = new Request.Builder().url(mUrl).delete(getRequestBody(mParams, mFileParams));
                break;
            }
            case METHOD_PUT: {
                requestBuilder = new Request.Builder().url(mUrl).put(getRequestBody(mParams, mFileParams));
                break;
            }
            case METHOD_PATCH: {
                requestBuilder = new Request.Builder().url(mUrl).patch(getRequestBody(mParams, mFileParams));
                break;
            }
            default:
                throw new IllegalArgumentException("Unsupported method:" + mMethod);
        }
        if (requestBuilder != null) {
            try {
                if (mHttpHeader != null) {
                    requestBuilder.headers(mHttpHeader);
                }
                Response response = HttpUtils.getResponse(requestBuilder.build());