test(file-print): extend booking document regression

This commit is contained in:
2026-08-31 20:56:52 +08:00
parent 0cc4eae209
commit 936412f351
8 changed files with 212 additions and 2 deletions
@@ -105,7 +105,9 @@ public class BusinessFileStorage {
normalized = normalized.substring(normalized.lastIndexOf('/') + 1)
.replaceAll("[\\p{Cntrl}]", "").trim();
if (normalized.isBlank()) return "attachment";
return normalized.length() <= 255 ? normalized : normalized.substring(normalized.length() - 255);
int codePoints = normalized.codePointCount(0, normalized.length());
if (codePoints <= 255) return normalized;
return normalized.substring(normalized.offsetByCodePoints(0, codePoints - 255));
}
private static String sha256(Path path) throws IOException {