Class DownloadClient

java.lang.Object
de.infolektuell.gradle.jextract.model.DownloadClient

public class DownloadClient extends Object
A service class for downloading files
  • Constructor Details

    • DownloadClient

      public DownloadClient()
      Creates a new instance
  • Method Details

    • download

      public void download(DownloadClient.Resource resource, Path target)
      Downloads a resource, checks its integrity, and stores it to a target path
      Parameters:
      resource - Data describing the download location and file checksum
      target - The file path to store the downloaded file
    • verify

      public boolean verify(DownloadClient.Resource resource, Path file)
      Checks that a given file is the downloaded file for a given resource by comparing their checksums.
      Parameters:
      resource - Data describing the remote downloadable file
      file - The file to verify
      Returns:
      True if the checksums match, false otherwise.