code: @SuppressWarnings("ResultOfMethodCallIgnored")
      public static boolean download(String downloadURL) {
          if (Checker.isHyperLink(downloadURL) && checkDownloadPath()) {
              logger.info("ready for download url: " + downloadURL + " storage in " + storageFolder);
          } else {
              logger.info("url or storage path are invalidated, can't download");
              return false;
          }
          int byteRead;
          String log = "download success from url '" + downloadURL + "' to local '";
          try {
              String fileName = checkPath(storageFolder + ValueConsts.SEPARATOR + Formatter.getFileName(downloadURL));
              String tmp = fileName + ".tmp";
              File file = new File(tmp);
              log += file.getAbsolutePath() + "'";
              URL url = new URL(downloadURL);
              HttpURLConnection conn = (HttpURLConnection) url.openConnection();
              InputStream inStream = NetUtils.getInputStreamOfConnection(conn);
              if (conn.getResponseCode() != ValueConsts.RESPONSE_OK || conn.getContentLength() <= 0) {
                  return false;
              }
              FileOutputStream fs = new FileOutputStream(file);
              if (!file.exists()) {
                  file.createNewFile();
              }
              byte[] buffer = new byte[1024];
              while ((byteRead = inStream.read(buffer)) != -1) {
                  fs.write(buffer, 0, byteRead);
              }
              fs.flush();
              inStream.close();
              fs.close();
              file.renameTo(new File(fileName));
              logger.info(log);
              return true;
          } catch (IOException e) {
              log = log.replace("success", "error") + ", message: " + e.getMessage();
              logger.error(log);
              return false;
          }
      }
docs: 下载文件
  
  @param downloadURL 下载的URL
  
  @return 是否下载成功