package com.hanwha.morakmorak.util

import android.content.Context
import android.net.ConnectivityManager
import android.net.NetworkInfo
import android.net.Uri

/**
 * Created by aaron on 2018-05-30
 */

class NetworkUtils {

    companion object {
//        @JvmStatic
//        fun isNetworkConnected(context: Context): Boolean {
//            val connectivityManager = context.getSystemService(Context.CONNECTIVITY_SERVICE)
//            return if (connectivityManager is ConnectivityManager) {
//                val networkInfo: NetworkInfo? = connectivityManager.activeNetworkInfo
//                networkInfo?.isConnected ?: false
//            } else false
//        }

        @JvmStatic fun parseUrlParameter(url: String) = HashMap<String, String?>().apply {
                Uri.parse(url).queryParameterNames.forEach { put(it, Uri.parse(url).getQueryParameter(it)) }
        }
    }

}// This class is not publicly instantiable
