class DownloadStrategy {

    public void inspectNetworkAvailable() throws UnknownHostException {
        if (isHasAccessNetworkStatePermission == null) {
            isHasAccessNetworkStatePermission = Util
                    .checkPermission(Manifest.permission.ACCESS_NETWORK_STATE);
        }

        // no permission will not check network available case.
        if (!isHasAccessNetworkStatePermission) return;

        if (manager == null) {
            manager = (ConnectivityManager) OkDownload.with().context()
                    .getSystemService(Context.CONNECTIVITY_SERVICE);
        }

        if (!Util.isNetworkAvailable(manager)) {
            throw new UnknownHostException("network is not available!");
        }
    }

}