Class DownloadClient
java.lang.Object
de.infolektuell.gradle.jextract.model.DownloadClient
A service class for downloading files
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordDescribes a downloadable file -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddownload(DownloadClient.Resource resource, Path target) Downloads a resource, checks its integrity, and stores it to a target pathbooleanverify(DownloadClient.Resource resource, Path file) Checks that a given file is the downloaded file for a given resource by comparing their checksums.
-
Constructor Details
-
DownloadClient
public DownloadClient()Creates a new instance
-
-
Method Details
-
download
Downloads a resource, checks its integrity, and stores it to a target path- Parameters:
resource- Data describing the download location and file checksumtarget- The file path to store the downloaded file
-
verify
Checks that a given file is the downloaded file for a given resource by comparing their checksums.- Parameters:
resource- Data describing the remote downloadable filefile- The file to verify- Returns:
- True if the checksums match, false otherwise.
-