Skip to content

Commit 45a9f8b

Browse files
committed
Re-add file separator to normalized SAF item path
1 parent 259c3dd commit 45a9f8b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -751,14 +751,16 @@ protected Item addItem(Context c, List<Collection> mycollections, String path,
751751
if (!itemPath.startsWith(path)) {
752752
throw new IOException("Illegal item metadata path: '" + itemPath);
753753
}
754+
// Normalization chops off the last separator, and we need to put it back
755+
String itemPathDir = itemPath.toString() + File.separatorChar;
754756

755757
// now fill out dublin core for item
756-
loadMetadata(c, myitem, itemPath.toString());
758+
loadMetadata(c, myitem, itemPathDir);
757759

758760
// and the bitstreams from the contents file
759761
// process contents file, add bistreams and bundles, return any
760762
// non-standard permissions
761-
List<String> options = processContentsFile(c, myitem, itemPath.toString(), "contents");
763+
List<String> options = processContentsFile(c, myitem, itemPathDir, "contents");
762764

763765
if (useWorkflow) {
764766
// don't process handle file
@@ -776,7 +778,7 @@ protected Item addItem(Context c, List<Collection> mycollections, String path,
776778
}
777779
} else {
778780
// only process handle file if not using workflow system
779-
String myhandle = processHandleFile(c, myitem, itemPath.toString(), "handle");
781+
String myhandle = processHandleFile(c, myitem, itemPathDir, "handle");
780782

781783
// put item in system
782784
if (!isTest) {

0 commit comments

Comments
 (0)