diff --git a/java/org/slub/rosetta/dps/repository/plugin/storage/nfs/SLUBStoragePlugin.java b/java/org/slub/rosetta/dps/repository/plugin/storage/nfs/SLUBStoragePlugin.java index f49870875a4ceaabd6e8ad2d6a198c32363f1a09..b3e159bec1aaad742ed0f19eb3b0e714b44baf4f 100644 --- a/java/org/slub/rosetta/dps/repository/plugin/storage/nfs/SLUBStoragePlugin.java +++ b/java/org/slub/rosetta/dps/repository/plugin/storage/nfs/SLUBStoragePlugin.java @@ -187,7 +187,15 @@ public class SLUBStoragePlugin extends AbstractStorageHandler { } finally { if (pluginname == null || pluginname.length() == 0) { - log.error("SLUBStoragePlugin failed to get pluginname, because it is empty. Possibly, there is no valid fixity type used or a CustomFixityPlugin missed"); + log.warn("SLUBStoragePlugin failed to get pluginname, because it is empty. Possibly, there is no valid fixity type used or a CustomFixityPlugin missed"); + log.warn("SLUBStoragePlugin.checkFixityByPlugin() trying to use fallback table to determine plugin name"); + String algorithm = fixity.getAlgorithm(); + if (algorithm == "SHA512") { + pluginname = "CustomFixitySHA512Plugin"; + log.info("SLUBStoragePlugin.checkFixityByPlugin() pluginname=" + pluginname); + } else { + log.error("SLUBStoragePlugin.checkFixityByPlugin() fallback table has no plugin name entry for algorithm '" + algorithm + "'"); + } } } @@ -199,7 +207,10 @@ public class SLUBStoragePlugin extends AbstractStorageHandler { catch (Exception e) { log.warn("SLUBStoragePlugin.checkFixityByPlugin() hard error getting previous fixity value, ", e.getMessage()); } - fixity.setValue(getChecksumUsingPlugin(isRelativePath ? getLocalFilePath(storedEntityIdentifier) : storedEntityIdentifier, fixity.getPluginName(), oldValue)); + fixity.setValue(getChecksumUsingPlugin(isRelativePath ? getLocalFilePath(storedEntityIdentifier) : storedEntityIdentifier, pluginname, oldValue)); + /* HINT: if plugin name is still empty a java.lang.NullPointerException gets thrown + Rosetta will handle it and let us know (creates technical issue in workbench) + */ fixity.setResult((oldValue == null) || (oldValue.equals(fixity.getValue()))); log.info("SLUBStoragePlugin.checkFixityByPlugin() newvalue=" + fixity.getValue()); result &= fixity.getResult();