code: protected File downloadFile(DriverDetails driverDetails, boolean shouldWeCheckFileHash) throws MojoExecutionException, IOException, URISyntaxException {
  
          URL remoteFileLocation = driverDetails.fileLocation;
  
          final String filename = FilenameUtils.getName(remoteFileLocation.getFile());
          for (int retryAttempts = 1; retryAttempts <= this.fileDownloadRetryAttempts; retryAttempts++) {
              File downloadedFile = fileDownloader.attemptToDownload(remoteFileLocation);
              if (null != downloadedFile) {
                  if (!shouldWeCheckFileHash || checkFileHash(downloadedFile, driverDetails.hash, driverDetails.hashType)) {
                      LOG.info("Archive file '" + downloadedFile.getName() + "' is valid : true");
                      return downloadedFile;
                  } else {
                      LOG.info("Archive file '" + downloadedFile.getName() + "' is valid : false");
                  }
              }
              LOG.info("Problem downloading '" + filename + "'... ");
              if (retryAttempts < this.fileDownloadRetryAttempts) {
                  LOG.info("Retry attempt " + (retryAttempts) + " for '" + filename + "'");
              }
          }
  
          throw new MojoExecutionException("Unable to successfully download '" + filename + "'!");
      }
docs: Perform the file download
  
  @param driverDetails         Driver details extracted from Repositorymap.xml
  @param shouldWeCheckFileHash true if file hash should be checked
  @return File
  @throws MojoExecutionException Unable to download file
  @throws IOException            Error writing to file system
  @throws URISyntaxException     Invalid URI