code: protected File downloadResource(URLConnection urlc,
              String downloadLocation) throws ResourceDownloadError {
          if (!urlc.getDoInput()) {
              urlc.setDoInput(true);
          }
  
          File downloadFile = new File(downloadLocation);
          try {
              File downloaded = File.createTempFile(
                      ProtocolHandlerConstants.BEL_FRAMEWORK_TMP_FILE_PREFIX,
                      null);
  
              IOUtils.copy(
                      urlc.getInputStream(),
                      new FileOutputStream(downloaded));
  
              FileUtils.copyFile(downloaded, downloadFile);
  
              // delete temp file holding download
              if (!downloaded.delete()) {
                  downloaded.deleteOnExit();
              }
          } catch (IOException e) {
              final String url = urlc.getURL().toString();
              final String msg = "I/O error";
              throw new ResourceDownloadError(url, msg, e);
          }
  
          return downloadFile;
      }
docs: Retrieves a resource from the {@code urlc} and save it to
  {@code downloadLocation}.
  
  @param urlc {@link URLConnection}, the url connection
  @param downloadLocation {@link String}, the location to save the
  resource content to
  @throws ResourceDownloadError Thrown if there was an I/O error
  downloading the resource