Skip to content

Commit 7d0f9bb

Browse files
authored
Fixup and newer cache (#2)
* fixup and newer cache * retry with old cache
1 parent 567b2bf commit 7d0f9bb

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

maven-plugin/src/main/java/DownloadRuntimesMojo.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,16 +111,15 @@ private void download(RuntimeFlavor flavor, Path destinationFile) throws IOExcep
111111
FileChannel fileChannel;
112112
try (var fileOutputStream = new FileOutputStream(destinationFile.toString())) {
113113
fileChannel = fileOutputStream.getChannel();
114-
}
115-
116-
getLog().info("Downloading to " + destinationFile);
114+
getLog().info("Downloading to " + destinationFile);
117115

118-
fileChannel.transferFrom(readableByteChannel, 0, Long.MAX_VALUE);
116+
fileChannel.transferFrom(readableByteChannel, 0, Long.MAX_VALUE);
119117

120-
var md5 = DigestUtils.sha256Hex(new FileInputStream(destinationFile.toFile()));
118+
var md5 = DigestUtils.sha256Hex(new FileInputStream(destinationFile.toFile()));
121119

122-
if (!md5.equals(flavor.getChecksum())) {
123-
throw new ChecksumException(String.format("Invalid checksum for %s", flavor.getUrl()));
120+
if (!md5.equals(flavor.getChecksum())) {
121+
throw new ChecksumException(String.format("Invalid checksum for %s", flavor.getUrl()));
122+
}
124123
}
125124
}
126125
}

0 commit comments

Comments
 (0)