From 75a520692ddbb02f085883bc7b6fa046e23a7c9c Mon Sep 17 00:00:00 2001 From: stoecker Date: Tue, 13 Aug 2024 15:53:31 +0000 Subject: [PATCH] fix #23850 - reduce long cache file names git-svn-id: https://josm.openstreetmap.de/svn/trunk@19194 0c6e7542-c601-0410-84e7-c038aed88b3b --- src/org/openstreetmap/josm/io/CachedFile.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/org/openstreetmap/josm/io/CachedFile.java b/src/org/openstreetmap/josm/io/CachedFile.java index 5fb53c05911..73b7623a306 100644 --- a/src/org/openstreetmap/josm/io/CachedFile.java +++ b/src/org/openstreetmap/josm/io/CachedFile.java @@ -484,6 +484,9 @@ private File checkLocal(URL url) throws IOException { } String a = urlStr.replaceAll("[^A-Za-z0-9_.-]", "_"); + if (a.length() > 120) { + a = a.substring(0, 100) + "_" + Utils.md5Hex(urlStr); + } String localPath = "mirror_" + a; localPath = truncatePath(destDir, localPath); destDirFile = new File(destDir, localPath + ".tmp");