Commits

Anonymous committed a456b65 Merge

merge

  • Participants
  • Parent commits b4ab946, ad0fb53
  • Branches production

Comments (0)

Files changed (1)

ingest-src/src/main/java/org/cdlib/mrt/ingest/utility/MetadataUtil.java

 
 	    String line = null;
 	    String tokens[] = null;
+	    boolean foundPrimary = false;
 	    while ((line = fileBuffer.readLine()) != null) {
 		if (dcPattern.matcher(line).matches()) {
 		    tokens = splitPattern.split(line, 2);
 
                     // a little hack to process local/primary IDs
                     if (tokens[0].matches("where")) {
-                        if (tokens[1].contains("ark:/")) tokens[0] = "where-primary";
-                        else tokens[0] = "where-local";
+                        if (tokens[1].contains("ark:/") && ! foundPrimary) {
+			    tokens[0] = "where-primary";
+			    foundPrimary = true;
+                        } else tokens[0] = "where-local";
                     }
 		    if (StringUtil.isNotEmpty(StringUtil.squeeze(tokens[1]))) {
 		        linkedHashMap.put(tokens[0], tokens[1]);