Skip to content

Commit 77b32f4

Browse files
committed
Retrieve clean metalink checksums
1 parent f35c7af commit 77b32f4

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

utils/src/main/java/com/cloud/utils/UriUtils.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,11 @@ public static List<String> getMetalinkChecksums(String url) {
350350
InputStream is = getMethod.getResponseBodyAsStream();
351351
Map<String, List<String>> checksums = getMultipleValuesFromXML(is, new String[] {"hash"});
352352
if (checksums.containsKey("hash")) {
353-
return checksums.get("hash");
353+
List<String> listChksum = new ArrayList<>();
354+
for (String chk : checksums.get("hash")) {
355+
listChksum.add(chk.replaceAll("\n", "").replaceAll(" ", "").trim());
356+
}
357+
return listChksum;
354358
}
355359
}
356360
} catch (IOException e) {

0 commit comments

Comments
 (0)