@@ -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