// Path: library/src/main/java/com/vincan/medialoader/tinyhttpd/HttpConstants.java
// public final class HttpConstants {
// 
//     public final static String CRLF = "\r\n";
// 
//     public final static String SP = " ";
// 
//     public final static String COLON = ":";
// 
//     public static final String CHARSET_DEFAULT = "UTF-8";
// 
//     public static final String PARAM_SIGN = "sign";
// 
//     public static final String PARAM_TIMESTAMP = "timestamp";
// 
//     private HttpConstants() {
//         // Unused
//     }
// }


import android.text.TextUtils;
import android.util.Base64;
import android.webkit.MimeTypeMap;
import com.vincan.medialoader.tinyhttpd.HttpConstants;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.security.InvalidKeyException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Locale;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;

                throw new NullPointerException(object.getClass().getSimpleName() + " cann't be null");
            }
        }
        return object;
    }

    public static String encode(String url) {
        try {
            return URLEncoder.encode(url, CHARSET_DEFAULT);
        } catch (UnsupportedEncodingException e) {
            throw new RuntimeException("Encoding not supported", e);
        }
    }

    public static String decode(String url) {
        try {
            return URLDecoder.decode(url, CHARSET_DEFAULT);
        } catch (UnsupportedEncodingException e) {
            throw new RuntimeException("Decoding not supported", e);
        }
    }

    public static String createUrl(String host, int port, String path) {
        return String.format(Locale.US, "http://%s:%d/%s", host, port, Util.encode(path));
    }

    public static String createUrl(String host, int port, String path, String secret) {
        String timestamp = String.valueOf(System.currentTimeMillis());
        String sign = getHmacSha1(path + timestamp, secret);
        StringBuilder sb = new StringBuilder("http://%s:%d/%s");

// Path: library/src/main/java/com/vincan/medialoader/tinyhttpd/HttpConstants.java
// public final class HttpConstants {
// 
//     public final static String CRLF = "\r\n";
// 
//     public final static String SP = " ";
// 
//     public final static String COLON = ":";
// 
//     public static final String CHARSET_DEFAULT = "UTF-8";
// 
//     public static final String PARAM_SIGN = "sign";
// 
//     public static final String PARAM_TIMESTAMP = "timestamp";
// 
//     private HttpConstants() {
//         // Unused
//     }
// }


// Path: library/src/main/java/com/vincan/medialoader/utils/Util.java
import android.text.TextUtils;
import android.util.Base64;
import android.webkit.MimeTypeMap;
import com.vincan.medialoader.tinyhttpd.HttpConstants;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.security.InvalidKeyException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Locale;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;

                throw new NullPointerException(object.getClass().getSimpleName() + " cann't be null");
            }
        }
        return object;
    }

    public static String encode(String url) {
        try {
            return URLEncoder.encode(url, CHARSET_DEFAULT);
        } catch (UnsupportedEncodingException e) {
            throw new RuntimeException("Encoding not supported", e);
        }
    }

    public static String decode(String url) {
        try {
            return URLDecoder.decode(url, CHARSET_DEFAULT);
        } catch (UnsupportedEncodingException e) {
            throw new RuntimeException("Decoding not supported", e);
        }
    }

    public static String createUrl(String host, int port, String path) {
        return String.format(Locale.US, "http://%s:%d/%s", host, port, Util.encode(path));
    }

    public static String createUrl(String host, int port, String path, String secret) {
        String timestamp = String.valueOf(System.currentTimeMillis());
        String sign = getHmacSha1(path + timestamp, secret);
        StringBuilder sb = new StringBuilder("http://%s:%d/%s");

        sb.append("?").append(HttpConstants.PARAM_SIGN).append("=%s");
