Code example for NetworkErrorException

0
 
        /* 
         * check net work 
         */ 
        if (!NetworkUtil.isNetworkAvailable()) { 
            throw new NetworkErrorException("Network blocked.");
        } 
 
        /* 
         * check file length 
         */ 
        client = AndroidHttpClient.newInstance("DownloadTask");
        httpGet = new HttpGet(mUrl);
        response = client.execute(httpGet);
        mTotalSize = response.getEntity().getContentLength();
 
        if (mFile.exists() && mTotalSize == mFile.length()) {
             LogUtil.d(TAG + "Output file already exists. Skipping download.");
 
//            throw new FileAlreadyExistException("Output file already exists. Skipping download."); 
        } else if (mTempFile.exists()) {