From f48d264f1c1a9b5e710e0b56a7ec2ae1a31d7cea Mon Sep 17 00:00:00 2001 From: Robert Stephan Date: Fri, 13 Sep 2024 11:36:03 +0200 Subject: [PATCH] MCRFileAttributes replace md5sum() with digest().toHexString() #85 --- .../datamodel/metadata/MCRExtendedDerivateLinkIDFactory.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jspdocportal-common-module/src/main/java/org/mycore/jspdocportal/common/controller/datamodel/metadata/MCRExtendedDerivateLinkIDFactory.java b/jspdocportal-common-module/src/main/java/org/mycore/jspdocportal/common/controller/datamodel/metadata/MCRExtendedDerivateLinkIDFactory.java index ae68f385..a0c63836 100644 --- a/jspdocportal-common-module/src/main/java/org/mycore/jspdocportal/common/controller/datamodel/metadata/MCRExtendedDerivateLinkIDFactory.java +++ b/jspdocportal-common-module/src/main/java/org/mycore/jspdocportal/common/controller/datamodel/metadata/MCRExtendedDerivateLinkIDFactory.java @@ -29,7 +29,7 @@ public MCREditableMetaEnrichedLinkID getDerivateLink(MCRDerivate der) { @SuppressWarnings("rawtypes") MCRFileAttributes attrs = Files.readAttributes(mcrPath, MCRFileAttributes.class); derivateLinkID.setOrCreateElement("maindoc_size", Long.toString(attrs.size())); - derivateLinkID.getContentList().add(new Element("maindoc_md5").setText(attrs.md5sum())); + derivateLinkID.getContentList().add(new Element("maindoc_"+attrs.digest().getAlgorithm().toLowerCase()).setText(attrs.digest().toHexString())); } catch (IOException e) { LOGGER.error(e); }