From b66a18bf40d2d8b3d1d9eee50bae407e2ecd7d66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B3nio=20Lindo?= Date: Tue, 30 Jan 2024 11:42:38 +0000 Subject: [PATCH] Fixed \ as file separators when writing lobpath to table.xml --- .../siard/out/content/SIARD2ContentExportStrategy.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dbptk-modules/dbptk-module-siard/src/main/java/com/databasepreservation/modules/siard/out/content/SIARD2ContentExportStrategy.java b/dbptk-modules/dbptk-module-siard/src/main/java/com/databasepreservation/modules/siard/out/content/SIARD2ContentExportStrategy.java index eccaa80f1..dd438c387 100644 --- a/dbptk-modules/dbptk-module-siard/src/main/java/com/databasepreservation/modules/siard/out/content/SIARD2ContentExportStrategy.java +++ b/dbptk-modules/dbptk-module-siard/src/main/java/com/databasepreservation/modules/siard/out/content/SIARD2ContentExportStrategy.java @@ -22,6 +22,7 @@ import java.util.List; import org.apache.commons.codec.binary.Hex; +import org.apache.commons.io.FilenameUtils; import org.apache.commons.io.IOUtils; import org.apache.commons.io.input.MessageDigestCalculatingInputStream; import org.apache.commons.lang3.tuple.Pair; @@ -398,8 +399,8 @@ protected void writeLargeObjectData(String cellPrefix, Cell cell, int columnInde byte[] messageDigest = digest.getMessageDigest().digest(); currentWriter.beginOpenTag(cellPrefix + columnIndex, 2).space().append("file=\"") - .append(contentPathStrategy.getBlobFilePath(currentSchema.getIndex(), currentTable.getIndex(), columnIndex, - currentRowIndex + 1)) + .append(FilenameUtils.separatorsToUnix(contentPathStrategy.getBlobFilePath(currentSchema.getIndex(), currentTable.getIndex(), columnIndex, + currentRowIndex + 1))) .append('"').space().append("length=\"").append(String.valueOf(binCell.getSize())).append("\"").space() .append("digest=\"").append(MessageDigestUtils.getHexFromMessageDigest(messageDigest, lowerCase)).append("\"") .space().append("digestType=\"").append(messageDigestAlgorithm.toUpperCase()).append("\"");