Skip to content

Commit

Permalink
Fixed \ as file separators when writing lobpath to table.xml
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonioG70 committed Jan 30, 2024
1 parent 1c97873 commit b66a18b
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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("\"");
Expand Down

0 comments on commit b66a18b

Please sign in to comment.