// Path: library/src/main/java/com/siu/android/volleyball/exception/BallException.java
// public class BallException extends RuntimeException {
// 
//     public BallException() {
//     }
// 
//     public BallException(String detailMessage) {
//         super(detailMessage);
//     }
// 
//     public BallException(String detailMessage, Object... args) {
//         super(String.format(detailMessage, args));
//     }
// 
// 
// 
//     public BallException(String detailMessage, Throwable throwable) {
//         super(detailMessage, throwable);
//     }
// 
//     public BallException(Throwable throwable) {
//         super(throwable);
//     }
// }
// 
// Path: library/src/main/java/com/siu/android/volleyball/util/BallLogger.java
// public class BallLogger {
// 
//     // D
//     public static void d(String string) {
//         Log.d(BallLogger.class.getName(), string);
//     }
// 
//     public static void d(String string, Throwable tr) {
//         Log.d(BallLogger.class.getName(), string, tr);
//     }
// 
//     public static void d(String string, Object... args) {
//         d(String.format(string, args));
//     }
// 
//     public static void d(String string, Throwable tr, Object... args) {
//         d(String.format(string, args), tr);
//     }
// 
// 
//     // E
//     public static void e(String string) {
//         Log.e(BallLogger.class.getName(), string);
//     }
// 
//     public static void e(String string, Throwable tr) {
//         Log.e(BallLogger.class.getName(), string, tr);
//     }
// 
//     public static void e(String string, Object... args) {
//         e(String.format(string, args));
//     }
// 
//     public static void e(String string, Throwable tr, Object... args) {
//         e(String.format(string, args), tr);
//     }
// }
// 
// Path: library/src/main/java/com/siu/android/volleyball/util/ConfigUtils.java
// public class ConfigUtils {
// 
//     public static final HttpStack getDefaultHttpStack(Context context) {
//         String userAgent = "volley/0";
//         try {
//             String packageName = context.getPackageName();
//             PackageInfo info = context.getPackageManager().getPackageInfo(packageName, 0);
//             userAgent = packageName + "/" + info.versionCode;
//         } catch (PackageManager.NameNotFoundException e) {
//         }
// 
//         HttpStack stack;
//         if (Build.VERSION.SDK_INT >= 9) {
//             stack = new HurlStack();
//         } else {
//             // Prior to Gingerbread, HttpUrlConnection was unreliable.
//             // See: http://android-developers.blogspot.com/2011/09/androids-http-clients.html
//             stack = new HttpClientStack(AndroidHttpClient.newInstance(userAgent));
//         }
// 
//         return stack;
//     }
// 
//     public static Network getDefaultNetwork(HttpStack httpStack) {
//         return new BasicNetwork(httpStack);
//     }
// 
//     public static Network getDefaultNetworkWithDefaultHttpStack(Context context) {
//         return new BasicNetwork(getDefaultHttpStack(context));
//     }
// }
// 
// Path: library/src/main/java/com/siu/android/volleyball/util/RequestUtils.java
// public class RequestUtils {
// 
//     /**
//      * Get the equivalent string of the int request http method
//      *
//      * @param method the method as int constant
//      * @return the method as string
//      * @throws IllegalArgumentException if no match is found between the int constant and the equivalent string
//      */
//     public static final String methodToString(int method) throws IllegalArgumentException {
//         switch (method) {
//             case Request.Method.GET:
//                 return "GET";
//             case Request.Method.POST:
//                 return "POST";
//             case Request.Method.PUT:
//                 return "PUT";
//             case Request.Method.DELETE:
//                 return "DELETE";
//         }
// 
//         throw new IllegalArgumentException("Unkown method for int constant " + method);
//     }
// }


import android.content.Context;
import com.android.volley.Network;
import com.android.volley.NetworkResponse;
import com.android.volley.NoConnectionError;
import com.android.volley.Request;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.HttpStack;
import com.siu.android.volleyball.exception.BallException;
import com.siu.android.volleyball.util.BallLogger;
import com.siu.android.volleyball.util.ConfigUtils;
import com.siu.android.volleyball.util.RequestUtils;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.io.IOUtils;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
package com.siu.android.volleyball.mock;





/**
 * Created by lukas on 8/29/13.
 */
public class FileMockNetwork implements Network {


    private Context mContext;
    private Config mConfig;

    public FileMockNetwork(Context context) {
        this(context, new Config());
    }

    public FileMockNetwork(Context context, Config config) {
        mContext = context;
        mConfig = config;

        // configure the real network for non mocked requests
        if (config.mRealNetwork == null) {
            HttpStack httpStack = (config.mRealNetworkHttpStack == null) ? ConfigUtils.getDefaultHttpStack(mContext) : config.mRealNetworkHttpStack;
// Path: library/src/main/java/com/siu/android/volleyball/exception/BallException.java
// public class BallException extends RuntimeException {
// 
//     public BallException() {
//     }
// 
//     public BallException(String detailMessage) {
//         super(detailMessage);
//     }
// 
//     public BallException(String detailMessage, Object... args) {
//         super(String.format(detailMessage, args));
//     }
// 
// 
// 
//     public BallException(String detailMessage, Throwable throwable) {
//         super(detailMessage, throwable);
//     }
// 
//     public BallException(Throwable throwable) {
//         super(throwable);
//     }
// }
// 
// Path: library/src/main/java/com/siu/android/volleyball/util/BallLogger.java
// public class BallLogger {
// 
//     // D
//     public static void d(String string) {
//         Log.d(BallLogger.class.getName(), string);
//     }
// 
//     public static void d(String string, Throwable tr) {
//         Log.d(BallLogger.class.getName(), string, tr);
//     }
// 
//     public static void d(String string, Object... args) {
//         d(String.format(string, args));
//     }
// 
//     public static void d(String string, Throwable tr, Object... args) {
//         d(String.format(string, args), tr);
//     }
// 
// 
//     // E
//     public static void e(String string) {
//         Log.e(BallLogger.class.getName(), string);
//     }
// 
//     public static void e(String string, Throwable tr) {
//         Log.e(BallLogger.class.getName(), string, tr);
//     }
// 
//     public static void e(String string, Object... args) {
//         e(String.format(string, args));
//     }
// 
//     public static void e(String string, Throwable tr, Object... args) {
//         e(String.format(string, args), tr);
//     }
// }
// 
// Path: library/src/main/java/com/siu/android/volleyball/util/ConfigUtils.java
// public class ConfigUtils {
// 
//     public static final HttpStack getDefaultHttpStack(Context context) {
//         String userAgent = "volley/0";
//         try {
//             String packageName = context.getPackageName();
//             PackageInfo info = context.getPackageManager().getPackageInfo(packageName, 0);
//             userAgent = packageName + "/" + info.versionCode;
//         } catch (PackageManager.NameNotFoundException e) {
//         }
// 
//         HttpStack stack;
//         if (Build.VERSION.SDK_INT >= 9) {
//             stack = new HurlStack();
//         } else {
//             // Prior to Gingerbread, HttpUrlConnection was unreliable.
//             // See: http://android-developers.blogspot.com/2011/09/androids-http-clients.html
//             stack = new HttpClientStack(AndroidHttpClient.newInstance(userAgent));
//         }
// 
//         return stack;
//     }
// 
//     public static Network getDefaultNetwork(HttpStack httpStack) {
//         return new BasicNetwork(httpStack);
//     }
// 
//     public static Network getDefaultNetworkWithDefaultHttpStack(Context context) {
//         return new BasicNetwork(getDefaultHttpStack(context));
//     }
// }
// 
// Path: library/src/main/java/com/siu/android/volleyball/util/RequestUtils.java
// public class RequestUtils {
// 
//     /**
//      * Get the equivalent string of the int request http method
//      *
//      * @param method the method as int constant
//      * @return the method as string
//      * @throws IllegalArgumentException if no match is found between the int constant and the equivalent string
//      */
//     public static final String methodToString(int method) throws IllegalArgumentException {
//         switch (method) {
//             case Request.Method.GET:
//                 return "GET";
//             case Request.Method.POST:
//                 return "POST";
//             case Request.Method.PUT:
//                 return "PUT";
//             case Request.Method.DELETE:
//                 return "DELETE";
//         }
// 
//         throw new IllegalArgumentException("Unkown method for int constant " + method);
//     }
// }


// Path: library/src/main/java/com/siu/android/volleyball/mock/FileMockNetwork.java
import android.content.Context;
import com.android.volley.Network;
import com.android.volley.NetworkResponse;
import com.android.volley.NoConnectionError;
import com.android.volley.Request;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.HttpStack;
import com.siu.android.volleyball.exception.BallException;
import com.siu.android.volleyball.util.BallLogger;
import com.siu.android.volleyball.util.ConfigUtils;
import com.siu.android.volleyball.util.RequestUtils;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.io.IOUtils;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;

package com.siu.android.volleyball.mock;





/**
 * Created by lukas on 8/29/13.
 */
public class FileMockNetwork implements Network {


    private Context mContext;
    private Config mConfig;

    public FileMockNetwork(Context context) {
        this(context, new Config());
    }

    public FileMockNetwork(Context context, Config config) {
        mContext = context;
        mConfig = config;

        // configure the real network for non mocked requests
        if (config.mRealNetwork == null) {
            HttpStack httpStack = (config.mRealNetworkHttpStack == null) ? ConfigUtils.getDefaultHttpStack(mContext) : config.mRealNetworkHttpStack;
            config.mRealNetwork = ConfigUtils.getDefaultNetwork(httpStack);