// Path: core/src/main/java/com/fenlisproject/elf/core/net/entity/FileFormData.java
// public class FileFormData implements MultipartFormData {
// 
//     private final String key;
//     private final File value;
// 
//     public FileFormData(String key, File value) {
//         this.key = key;
//         this.value = value;
//     }
// 
//     @Override
//     public String getKey() {
//         return key;
//     }
// 
//     @Override
//     public File getValue() {
//         return value;
//     }
// }
// 
// Path: core/src/main/java/com/fenlisproject/elf/core/net/entity/MultipartFormData.java
// public interface MultipartFormData {
// 
//     String getKey();
// 
//     Object getValue();
// }
// 
// Path: core/src/main/java/com/fenlisproject/elf/core/net/entity/StringFormData.java
// public class StringFormData implements MultipartFormData {
// 
//     private final String key;
//     private final String value;
// 
//     public StringFormData(String key, String value) {
//         this.key = key;
//         this.value = value;
//     }
// 
//     @Override
//     public String getKey() {
//         return key;
//     }
// 
//     @Override
//     public String getValue() {
//         return value;
//     }
// }
// 
// Path: core/src/main/java/com/fenlisproject/elf/core/util/FileUtils.java
// public class FileUtils {
// 
//     private FileUtils() {
//     }
// 
//     public static boolean writeStreamToFile(InputStream in, String outFileName) {
//         OutputStream out = null;
//         try {
//             out = new FileOutputStream(outFileName);
//             byte[] buf = new byte[1024];
//             int len;
//             while ((len = in.read(buf)) > 0) {
//                 out.write(buf, 0, len);
//             }
//             in.close();
//             out.close();
//             return true;
//         } catch (FileNotFoundException e) {
//             e.printStackTrace();
//         } catch (IOException e) {
//             e.printStackTrace();
//         } finally {
//             try {
//                 in.close();
//             } catch (Exception e) {
//                 e.printStackTrace();
//             }
//             try {
//                 out.close();
//             } catch (Exception e) {
//                 e.printStackTrace();
//             }
//         }
//         return false;
//     }
// 
//     public static boolean copy(String source, String destination) {
//         InputStream in = null;
//         OutputStream out = null;
//         try {
//             in = new FileInputStream(source);
//             out = new FileOutputStream(destination);
//             byte[] buf = new byte[1024];
//             int len;
//             while ((len = in.read(buf)) > 0) {
//                 out.write(buf, 0, len);
//             }
//             in.close();
//             out.close();
//             return true;
//         } catch (FileNotFoundException e) {
//             e.printStackTrace();
//         } catch (IOException e) {
//             e.printStackTrace();
//         } finally {
//             try {
//                 in.close();
//             } catch (Exception e) {
//                 e.printStackTrace();
//             }
//             try {
//                 out.close();
//             } catch (Exception e) {
//                 e.printStackTrace();
//             }
//         }
//         return false;
//     }
// 
//     public static boolean delete(String fileName) {
//         File file = new File(fileName);
//         return file.delete();
//     }
// 
//     public static boolean isExist(String fileName) {
//         return new File(fileName).exists();
//     }
// 
//     public static void createDirsIfNotExist(String path) {
//         File file = new File(path);
//         if (!file.exists()) {
//             file.mkdirs();
//         }
//     }
// 
//     public static String getMimeType(File file) {
//         String extension = MimeTypeMap.getFileExtensionFromUrl(file.getAbsolutePath());
//         if (extension != null) {
//             MimeTypeMap mime = MimeTypeMap.getSingleton();
//             return mime.getMimeTypeFromExtension(extension);
//         }
//         return null;
//     }
// 
// }


import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import com.fenlisproject.elf.core.net.entity.FileFormData;
import com.fenlisproject.elf.core.net.entity.MultipartFormData;
import com.fenlisproject.elf.core.net.entity.StringFormData;
import com.fenlisproject.elf.core.util.FileUtils;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.net.ProtocolException;
import java.net.URL;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
        public Builder(String url) {
            this.mRequestUrl = url;
            this.isUseCache = false;
            this.isForceUseCache = false;
            this.mRequestMethod = RequestMethod.GET;
            this.mUrlParams = new ArrayList<>();
            this.mUrlEncodedFormData = new ArrayList<>();
            this.mFormData = new ArrayList<>();
            this.mHeaders = new ArrayList<>();
            this.mConnectionTimeout = DEFAULT_CONNECTION_TIMEOUT;
            this.mReadTimeout = DEFAULT_READ_TIMEOUT;
            this.mRetryCount = 1;
        }

        public Builder addRequestHeader(String key, String value) {
            this.mHeaders.add(new BasicNameValuePair(key, value));
            return this;
        }

        public Builder addUrlParams(String key, String value) {
            this.mUrlParams.add(new BasicNameValuePair(key, value));
            return this;
        }

        public Builder addUrlEncodedFormData(String key, String value) {
            this.mUrlEncodedFormData.add(new BasicNameValuePair(key, value));
            return this;
        }

        public Builder addFormData(String key, String value) {
// Path: core/src/main/java/com/fenlisproject/elf/core/net/entity/FileFormData.java
// public class FileFormData implements MultipartFormData {
// 
//     private final String key;
//     private final File value;
// 
//     public FileFormData(String key, File value) {
//         this.key = key;
//         this.value = value;
//     }
// 
//     @Override
//     public String getKey() {
//         return key;
//     }
// 
//     @Override
//     public File getValue() {
//         return value;
//     }
// }
// 
// Path: core/src/main/java/com/fenlisproject/elf/core/net/entity/MultipartFormData.java
// public interface MultipartFormData {
// 
//     String getKey();
// 
//     Object getValue();
// }
// 
// Path: core/src/main/java/com/fenlisproject/elf/core/net/entity/StringFormData.java
// public class StringFormData implements MultipartFormData {
// 
//     private final String key;
//     private final String value;
// 
//     public StringFormData(String key, String value) {
//         this.key = key;
//         this.value = value;
//     }
// 
//     @Override
//     public String getKey() {
//         return key;
//     }
// 
//     @Override
//     public String getValue() {
//         return value;
//     }
// }
// 
// Path: core/src/main/java/com/fenlisproject/elf/core/util/FileUtils.java
// public class FileUtils {
// 
//     private FileUtils() {
//     }
// 
//     public static boolean writeStreamToFile(InputStream in, String outFileName) {
//         OutputStream out = null;
//         try {
//             out = new FileOutputStream(outFileName);
//             byte[] buf = new byte[1024];
//             int len;
//             while ((len = in.read(buf)) > 0) {
//                 out.write(buf, 0, len);
//             }
//             in.close();
//             out.close();
//             return true;
//         } catch (FileNotFoundException e) {
//             e.printStackTrace();
//         } catch (IOException e) {
//             e.printStackTrace();
//         } finally {
//             try {
//                 in.close();
//             } catch (Exception e) {
//                 e.printStackTrace();
//             }
//             try {
//                 out.close();
//             } catch (Exception e) {
//                 e.printStackTrace();
//             }
//         }
//         return false;
//     }
// 
//     public static boolean copy(String source, String destination) {
//         InputStream in = null;
//         OutputStream out = null;
//         try {
//             in = new FileInputStream(source);
//             out = new FileOutputStream(destination);
//             byte[] buf = new byte[1024];
//             int len;
//             while ((len = in.read(buf)) > 0) {
//                 out.write(buf, 0, len);
//             }
//             in.close();
//             out.close();
//             return true;
//         } catch (FileNotFoundException e) {
//             e.printStackTrace();
//         } catch (IOException e) {
//             e.printStackTrace();
//         } finally {
//             try {
//                 in.close();
//             } catch (Exception e) {
//                 e.printStackTrace();
//             }
//             try {
//                 out.close();
//             } catch (Exception e) {
//                 e.printStackTrace();
//             }
//         }
//         return false;
//     }
// 
//     public static boolean delete(String fileName) {
//         File file = new File(fileName);
//         return file.delete();
//     }
// 
//     public static boolean isExist(String fileName) {
//         return new File(fileName).exists();
//     }
// 
//     public static void createDirsIfNotExist(String path) {
//         File file = new File(path);
//         if (!file.exists()) {
//             file.mkdirs();
//         }
//     }
// 
//     public static String getMimeType(File file) {
//         String extension = MimeTypeMap.getFileExtensionFromUrl(file.getAbsolutePath());
//         if (extension != null) {
//             MimeTypeMap mime = MimeTypeMap.getSingleton();
//             return mime.getMimeTypeFromExtension(extension);
//         }
//         return null;
//     }
// 
// }


// Path: core/src/main/java/com/fenlisproject/elf/core/net/HttpRequest.java
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import com.fenlisproject.elf.core.net.entity.FileFormData;
import com.fenlisproject.elf.core.net.entity.MultipartFormData;
import com.fenlisproject.elf.core.net.entity.StringFormData;
import com.fenlisproject.elf.core.util.FileUtils;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.net.ProtocolException;
import java.net.URL;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;

        public Builder(String url) {
            this.mRequestUrl = url;
            this.isUseCache = false;
            this.isForceUseCache = false;
            this.mRequestMethod = RequestMethod.GET;
            this.mUrlParams = new ArrayList<>();
            this.mUrlEncodedFormData = new ArrayList<>();
            this.mFormData = new ArrayList<>();
            this.mHeaders = new ArrayList<>();
            this.mConnectionTimeout = DEFAULT_CONNECTION_TIMEOUT;
            this.mReadTimeout = DEFAULT_READ_TIMEOUT;
            this.mRetryCount = 1;
        }

        public Builder addRequestHeader(String key, String value) {
            this.mHeaders.add(new BasicNameValuePair(key, value));
            return this;
        }

        public Builder addUrlParams(String key, String value) {
            this.mUrlParams.add(new BasicNameValuePair(key, value));
            return this;
        }

        public Builder addUrlEncodedFormData(String key, String value) {
            this.mUrlEncodedFormData.add(new BasicNameValuePair(key, value));
            return this;
        }

        public Builder addFormData(String key, String value) {
            this.mFormData.add(new StringFormData(key, value));