Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
StoragePlugin4Rosetta
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Harbor Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Digital Preservation
StoragePlugin4Rosetta
Commits
e99c043f
Commit
e99c043f
authored
4 years ago
by
Andreas Romeyke
Browse files
Options
Downloads
Patches
Plain Diff
- fixed some spotifybugs warnings
parent
de1e9472
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
java/org/slub/rosetta/dps/repository/plugin/storage/nfs/SLUBStoragePlugin.java
+10
-8
10 additions, 8 deletions
.../dps/repository/plugin/storage/nfs/SLUBStoragePlugin.java
with
10 additions
and
8 deletions
java/org/slub/rosetta/dps/repository/plugin/storage/nfs/SLUBStoragePlugin.java
+
10
−
8
View file @
e99c043f
...
...
@@ -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
;
}
File
OutputStream
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
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment