Skip to content
Snippets Groups Projects
Commit 290a6426 authored by Andreas Romeyke's avatar Andreas Romeyke
Browse files

- added more debugging info to track a nullpointer error in code copied from

NFSStorage Plugin
parent 06517d6d
No related branches found
No related tags found
No related merge requests found
......@@ -6,7 +6,7 @@
<fr:x_form xmlns:fr="http://com/exlibris/digitool/common/forms/xmlbeans">
<form_name>SLUBStoragePlugin_Params</form_name>
<description>SLUBTreeStoragePlugin_parameters_form</description>
<version>0.2</version>
<version>1.0</version>
<grid_x>1</grid_x>
<md_format>1</md_format>
<x_fields>
......@@ -70,7 +70,7 @@
</fr:x_form>
</pl:initParameters>
<pl:description>SLUB Storage Plugin</pl:description>
<pl:version>2.5</pl:version>
<pl:version>2.801</pl:version>
<pl:materialType>DIGITAL</pl:materialType>
<pl:module>Repository</pl:module>
<pl:generalType>TASK</pl:generalType>
......
......@@ -91,26 +91,35 @@ public class SLUBStoragePlugin extends AbstractStorageHandler {
fixity.setResult(null);
if (Fixity.FixityAlgorithm.MD5.toString().equals(fixity.getAlgorithm()))
{
log.info("SLUBStoragePlugin.checkFixity() calcMD5=true");
calcMD5 = true;
}
else if (Fixity.FixityAlgorithm.SHA1.toString().equals(fixity.getAlgorithm()))
{
log.info("SLUBStoragePlugin.checkFixity() calcSHA1=true");
calcSHA1 = true;
}
else if (Fixity.FixityAlgorithm.CRC32.toString().equals(fixity.getAlgorithm()))
{
log.info("SLUBStoragePlugin.checkFixity() calcCRC32=true");
calcCRC32 = true;
}
else
{
log.info("SLUBStoragePlugin.checkFixity() another fixity");
log.info("SLUBStoragePlugin.checkFixity() pluginname=" + fixity.getPluginName());
String oldValue = fixity.getValue();
log.info("SLUBStoragePlugin.checkFixity() oldvalue=" + oldValue);
fixity.setValue(getChecksumUsingPlugin(isRelativePath ? getLocalFilePath(storedEntityIdentifier) : storedEntityIdentifier, fixity.getPluginName(), oldValue));
fixity.setResult(Boolean.valueOf((oldValue == null) || (oldValue.equals(fixity.getValue()))));
log.info("SLUBStoragePlugin.checkFixity() newvalue=" + fixity.getValue());
result &= fixity.getResult().booleanValue();
log.info("SLUBStoragePlugin.checkFixity() result=" + result);
}
}
if ((calcMD5) || (calcSHA1) || (calcCRC32))
{
log.info("SLUBStoragePlugin.checkFixity() calcMD5|calcSHA1|calcCRC32=true");
InputStream is = null;
try
{
......@@ -121,16 +130,23 @@ public class SLUBStoragePlugin extends AbstractStorageHandler {
int checksummerAlgorithmIndex = getChecksummerAlgorithmIndex(fixity.getAlgorithm());
if (checksummerAlgorithmIndex != -1)
{
log.info("SLUBStoragePlugin.checkFixity() checksummerAlgorithmIndex=" + checksummerAlgorithmIndex);
String oldValue = fixity.getValue();
log.info("SLUBStoragePlugin.checkFixity() getAlgorithm=" + fixity.getAlgorithm());
log.info("SLUBStoragePlugin.checkFixity() oldvalue=" + oldValue);
fixity.setValue(checksummer.getChecksum(fixity.getAlgorithm()));
log.info("SLUBStoragePlugin.checkFixity() newvalue=" + fixity.getValue());
fixity.setResult(Boolean.valueOf((oldValue == null) || (oldValue.equalsIgnoreCase(fixity.getValue()))));
result &= fixity.getResult().booleanValue();
log.info("SLUBStoragePlugin.checkFixity() result=" + result);
}
}
}
finally
{
log.info("SLUBStoragePlugin.checkFixity() finally called");
if (is != null) {
log.info("SLUBStoragePlugin.checkFixity()is closed");
is.close();
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment