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

- minor fix, string compare using constant first (avoids problems if string is null)

- added log.info about which method is used
parent 07d8d9df
Branches
Tags
No related merge requests found
......@@ -179,7 +179,7 @@ public class SLUBStoragePlugin extends AbstractStorageHandler {
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.equals("SHA512")) {
if ("SHA512".equals(algorithm)) {
pluginname = "CustomFixitySHA512Plugin";
log.info("SLUBStoragePlugin.checkFixityByPlugin() pluginname=" + pluginname);
} else {
......@@ -295,6 +295,7 @@ public class SLUBStoragePlugin extends AbstractStorageHandler {
is.close();
}
copyStream(storedEntityMetadata, destFilePath);
log.info("SLUBStoragePlugin.storeEntity() try copy (copyStream) was successfull");
}
else
{
......@@ -307,7 +308,7 @@ public class SLUBStoragePlugin extends AbstractStorageHandler {
try (OutputStream output = java.nio.file.Files.newOutputStream( Paths.get( destFilePath)))
{
IOUtil.copy(is, output, default_buffer);
log.debug("SLUBStoragePlugin.storeEntity() try copy was successfull");
log.info("SLUBStoragePlugin.storeEntity() try copy (IOUtil.copy) was successfull");
}
}
if (!checkFixity(storedEntityMetadata.getFixities(), storedEntityIdentifier)) {
......@@ -338,19 +339,23 @@ public class SLUBStoragePlugin extends AbstractStorageHandler {
assert canonicalSrcFile != null;
FileUtil.moveFile(canonicalSrcFile, new File(destPath));
saveDestPathsTmpFile(iePid, pid, destPath);
log.info("SLUBStoragePlugin.copyStream(), move was successful");
}
else if ("soft_link".equalsIgnoreCase(filesHandlingMethod))
{
softLink(srcPath, destPath);
log.info("SLUBStoragePlugin.copyStream(), softlink was successful");
}
else if ("hard_link".equalsIgnoreCase(filesHandlingMethod))
{
hardLink(srcPath, destPath);
log.info("SLUBStoragePlugin.copyStream(), hardlink was successful");
}
else
{
FileUtil.copyFile(srcPath, destPath);
saveDestPathsTmpFile(iePid, pid, destPath);
log.info("SLUBStoragePlugin.copyStream(), copyFile was successful");
}
}
protected String getFilePathInDescIfExists(StoredEntityMetaData storedEntityMetadata)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment