From 97cce1cc0e73c3d572d1ff816cf54b40f69b46c1 Mon Sep 17 00:00:00 2001 From: Carlos Afonso Date: Wed, 5 Jun 2024 17:06:25 +0100 Subject: [PATCH] Added fix to other metadata in order to work with eudor eupos --- .../main/java/org/roda/core/index/IndexModelObserver.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/roda-core/roda-core/src/main/java/org/roda/core/index/IndexModelObserver.java b/roda-core/roda-core/src/main/java/org/roda/core/index/IndexModelObserver.java index a80a75f0ec..a419bddf8e 100644 --- a/roda-core/roda-core/src/main/java/org/roda/core/index/IndexModelObserver.java +++ b/roda-core/roda-core/src/main/java/org/roda/core/index/IndexModelObserver.java @@ -289,9 +289,11 @@ private ReturnWithExceptions indexRepresentation(final AIP // suppose that all suffixes in othermetadata are like this // ".metadata. String fileId = otherMetadata.get().getFileId(); - suffix = fileId.substring(fileId.lastIndexOf(".")) + suffix; - fileId = fileId.substring(0, fileId.lastIndexOf(".")); + if (fileId.lastIndexOf(".") != -1) { + suffix = fileId.substring(fileId.lastIndexOf(".")) + suffix; + fileId = fileId.substring(0, fileId.lastIndexOf(".")); + } OtherMetadata om = model.retrieveOtherMetadata(aip.getId(), representation.getId(), path, fileId, suffix, type); otherMetadataCreated(om);