Skip to content
Snippets Groups Projects
Commit b2dab0f3 authored by Jens Steidl's avatar Jens Steidl :baby_chick:
Browse files

- workaround: added fallback for empty custom fixity plugin names

parent 74f0686c
Branches
Tags
No related merge requests found
...@@ -187,7 +187,15 @@ public class SLUBStoragePlugin extends AbstractStorageHandler { ...@@ -187,7 +187,15 @@ public class SLUBStoragePlugin extends AbstractStorageHandler {
} }
finally { finally {
if (pluginname == null || pluginname.length() == 0) { 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 { ...@@ -199,7 +207,10 @@ public class SLUBStoragePlugin extends AbstractStorageHandler {
catch (Exception e) { catch (Exception e) {
log.warn("SLUBStoragePlugin.checkFixityByPlugin() hard error getting previous fixity value, ", e.getMessage()); 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()))); fixity.setResult((oldValue == null) || (oldValue.equals(fixity.getValue())));
log.info("SLUBStoragePlugin.checkFixityByPlugin() newvalue=" + fixity.getValue()); log.info("SLUBStoragePlugin.checkFixityByPlugin() newvalue=" + fixity.getValue());
result &= fixity.getResult(); result &= fixity.getResult();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment