use of org.apache.commons.codec.digest.DigestUtils in project zaproxy by zaproxy.
the class CreateGitHubRelease method appendChecksumsTable.
private void appendChecksumsTable(StringBuilder body) throws IOException {
String algorithm = checksumAlgorithm.get();
body.append("| File | Checksum (").append(algorithm).append(") |\n");
body.append("|---|---|\n");
String baseDownloadLink = "https://github.com/" + repo.get() + "/releases/download/" + tag.get() + "/";
DigestUtils digestUtils = new DigestUtils(algorithm);
List<File> files = assets.stream().map(e -> e.getFile().getAsFile().get()).sorted((a, b) -> a.getName().compareTo(b.getName())).collect(Collectors.toList());
for (File file : files) {
String fileName = file.getName();
body.append("| [").append(fileName).append("](").append(baseDownloadLink).append(fileName).append(") | `").append(digestUtils.digestAsHex(file)).append("` |\n");
}
}
Aggregations