// 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));
//     }
// }


import android.content.Context;
import com.android.volley.Cache;
import com.android.volley.Network;
import com.android.volley.toolbox.DiskBasedCache;
import com.android.volley.toolbox.HttpStack;
import com.siu.android.volleyball.util.ConfigUtils;
import java.io.File;
package com.siu.android.volleyball.toolbox;




/**
 * Created by lukas on 8/29/13.
 */
public class VolleyBallConfig {

    private static final String DEFAULT_CACHE_DIR = "volley";

    private Context mContext;
    private HttpStack mHttpStack;
    private Network mNetwork;
    private Cache mCache;

    private VolleyBallConfig() {
    }

    public static class Builder {
        private VolleyBallConfig mInstance;

        public Builder(Context context) {
            mInstance = new VolleyBallConfig();
            mInstance.mContext = context;
        }

        public Builder httpStack(HttpStack httpStack) {
            mInstance.mHttpStack = httpStack;
            return this;
        }

        public Builder network(Network network) {
            mInstance.mNetwork = network;
            return this;
        }

        public Builder cache(Cache cache) {
            mInstance.mCache = cache;
            return this;
        }

        public VolleyBallConfig build() {
            if (mInstance.mHttpStack == null) {
// 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/toolbox/VolleyBallConfig.java
import android.content.Context;
import com.android.volley.Cache;
import com.android.volley.Network;
import com.android.volley.toolbox.DiskBasedCache;
import com.android.volley.toolbox.HttpStack;
import com.siu.android.volleyball.util.ConfigUtils;
import java.io.File;

package com.siu.android.volleyball.toolbox;




/**
 * Created by lukas on 8/29/13.
 */
public class VolleyBallConfig {

    private static final String DEFAULT_CACHE_DIR = "volley";

    private Context mContext;
    private HttpStack mHttpStack;
    private Network mNetwork;
    private Cache mCache;

    private VolleyBallConfig() {
    }

    public static class Builder {
        private VolleyBallConfig mInstance;

        public Builder(Context context) {
            mInstance = new VolleyBallConfig();
            mInstance.mContext = context;
        }

        public Builder httpStack(HttpStack httpStack) {
            mInstance.mHttpStack = httpStack;
            return this;
        }

        public Builder network(Network network) {
            mInstance.mNetwork = network;
            return this;
        }

        public Builder cache(Cache cache) {
            mInstance.mCache = cache;
            return this;
        }

        public VolleyBallConfig build() {
            if (mInstance.mHttpStack == null) {
                mInstance.mHttpStack = ConfigUtils.getDefaultHttpStack(mInstance.mContext);