支持下载 OpenJ9 (#3363)

* 支持下载 OpenJ9

* update
This commit is contained in:
Glavo
2024-10-19 22:59:40 +08:00
committed by GitHub
parent 5c767deaf3
commit a27671560d
2 changed files with 17 additions and 3 deletions

View File

@@ -312,8 +312,15 @@ public final class JavaDownloadDialog extends StackPane {
getIntegrityCheck = Task.completed(new FileDownloadTask.IntegrityCheck(fileInfo.getChecksumType(), fileInfo.getChecksum()));
else if (StringUtils.isNotBlank(fileInfo.getChecksumUri()))
getIntegrityCheck = new GetTask(downloadProvider.injectURLWithCandidates(fileInfo.getChecksumUri()))
.thenApplyAsync(checksum ->
new FileDownloadTask.IntegrityCheck(fileInfo.getChecksumType(), checksum.trim()));
.thenApplyAsync(checksum -> {
checksum = checksum.trim();
int idx = checksum.indexOf(' ');
if (idx > 0)
checksum = checksum.substring(0, idx);
return new FileDownloadTask.IntegrityCheck(fileInfo.getChecksumType(), checksum);
});
else
throw new IOException("Unable to get checksum for file");