class DownloadStrategy {

    public void inspectNetworkOnWifi(@NonNull DownloadTask task) throws IOException {
        if (isHasAccessNetworkStatePermission == null) {
            isHasAccessNetworkStatePermission = Util
                    .checkPermission(Manifest.permission.ACCESS_NETWORK_STATE);
        }

        if (!task.isWifiRequired()) return;

        if (!isHasAccessNetworkStatePermission) {
            throw new IOException("required for access network state but don't have the "
                    + "permission of Manifest.permission.ACCESS_NETWORK_STATE, please declare this "
                    + "permission first on your AndroidManifest, so we can handle the case of "
                    + "downloading required wifi state.");
        }

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

        if (Util.isNetworkNotOnWifiType(manager)) {
            throw new NetworkPolicyException();
        }
    }

}