code: private String localFilePath(File downloadDirectory) throws MojoFailureException {
          if (downloadDirectory.exists()) {
              if (downloadDirectory.isDirectory()) {
                  return downloadDirectory.getAbsolutePath();
              } else {
                  throw new MojoFailureException("'" + downloadDirectory.getAbsolutePath() + "' is not a directory!");
              }
          }
  
          if (downloadDirectory.mkdirs()) {
              return downloadDirectory.getAbsolutePath();
          } else {
              throw new MojoFailureException("Unable to create download directory!");
          }
      }
docs: Set the location directory where files will be downloaded to
  
  @param downloadDirectory The directory that the file will be downloaded to.