use of de.undercouch.gradle.tasks.download.DownloadAction in project zaproxy by zaproxy.
the class DownloadAddOns method downloadFile.
private void downloadFile(AddOnDownloadData downloadData) throws IOException {
File file = downloadData.getOutputFile();
DownloadAction downloadAction = new DownloadAction(getProject());
downloadAction.src(downloadData.getUrl());
downloadAction.dest(file);
downloadAction.execute();
String computedHash = hash(file);
if (!computedHash.equalsIgnoreCase(downloadData.getHash())) {
throw new IOException("Hash mismatch for file " + file + " expected " + downloadData.getHash() + " but got " + computedHash);
}
}
Aggregations