Skip to content

Commit 3d1fff1

Browse files
committed
remove collision prevention part from EAD file name for the PI value;
fixes #26709
1 parent 48f6dae commit 3d1fff1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

goobi-viewer-indexer/src/main/java/io/goobi/viewer/indexer/EadIndexer.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,12 @@ public String[] index(Path eadFile, Map<String, Path> dataFolders, final ISolrWr
206206
setSimpleData(indexObj);
207207

208208
// Set PI (from file name)
209-
String pi = validateAndApplyPI(MetadataHelper.applyIdentifierModifications(FilenameUtils.getBaseName(eadFile.getFileName().toString())),
209+
String baseFileName = eadFile.getFileName().toString();
210+
// Remove anti-collision name part
211+
if (baseFileName.contains("#")) {
212+
baseFileName = baseFileName.substring(0, baseFileName.indexOf('#'));
213+
}
214+
String pi = validateAndApplyPI(MetadataHelper.applyIdentifierModifications(FilenameUtils.getBaseName(baseFileName)),
210215
indexObj, false);
211216

212217
// Determine the data repository to use

0 commit comments

Comments
 (0)