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

- fixed some spotifybugs warnings

parent de1e9472
No related branches found
No related tags found
No related merge requests found
......@@ -34,11 +34,10 @@ import com.exlibris.digitool.common.storage.Fixity;
import com.exlibris.digitool.infrastructure.utils.Checksummer;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.RandomAccessFile;
import java.security.NoSuchAlgorithmException;
import java.text.SimpleDateFormat;
......@@ -76,8 +75,8 @@ public class SLUBStoragePlugin extends AbstractStorageHandler {
private static final String DIR_ROOT = "DIR_ROOT"; /** {@inheritDoc} */
private static final String FILE_PER_DIR = "FILE_PER_DIR";
private static final String FILES_HANDLING_METHOD = "FILES_HANDLING_METHOD";
private final String RELATIVE_DIRECTORY_PATH = "relativeDirectoryPath";
private final String DEST_FILE_PATH = "destFilePath";
final String RELATIVE_DIRECTORY_PATH = "relativeDirectoryPath";
final String DEST_FILE_PATH = "destFilePath";
public SLUBStoragePlugin() {
log.info("SLUBStoragePlugin instantiated");
......@@ -244,7 +243,8 @@ public class SLUBStoragePlugin extends AbstractStorageHandler {
throws IOException
{
log.info("SLUBStoragePlugin.retrieveEntity() with '" + storedEntityIdentifier + "' isrelative=" + isRelative);
return new FileInputStream((isRelative ? this.parameters.get("DIR_ROOT") : "") + storedEntityIdentifier);
File file = new File((isRelative ? this.parameters.get("DIR_ROOT") : "") + storedEntityIdentifier);
return java.nio.file.Files.newInputStream( file.toPath());
}
public byte[] retrieveEntityByRange(String storedEntityIdentifier, long start, long end)
{
......@@ -319,10 +319,11 @@ public class SLUBStoragePlugin extends AbstractStorageHandler {
log.warn("SLUBStoragePlugin.storeEntity() InputStream is null");
return null;
}
FileOutputStream output = null;
OutputStream output = null;
try
{
output = new FileOutputStream(new File(destFilePath));
File file = new File(destFilePath);
output = java.nio.file.Files.newOutputStream( file.toPath());
IOUtil.copy(is, output);
log.debug("SLUBStoragePlugin.storeEntity() try copy was successfull");
}
......@@ -476,6 +477,7 @@ public class SLUBStoragePlugin extends AbstractStorageHandler {
* @return calculated relative path as String
* returns the path as string
*/
String getStreamRelativePath(StoredEntityMetaData storedEntityMetaData) throws Exception {
log.info("SLUBStoragePlugin.getStreamRelativePath()");
if ((null == storedEntityMetaData)) throw new AssertionError();
......@@ -501,7 +503,7 @@ public class SLUBStoragePlugin extends AbstractStorageHandler {
log.debug("SLUBStoragePlugin.getStreamRelativePath iesec=" + iesec.toString());
List<DnxSectionRecord> records = iesec.getRecordList();
for (DnxSectionRecord element : records) {
if (element.getKeyById("internalIdentifierType").getValue().equals("PID")) {
if ("PID".equals(element.getKeyById("internalIdentifierType").getValue())) {
iepid = element.getKeyById("internalIdentifierValue").getValue(); // found IEPID
break;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment