Skip to content

Commit

Permalink
fix #23850 - reduce long cache file names
Browse files Browse the repository at this point in the history
git-svn-id: https://josm.openstreetmap.de/svn/trunk@19194 0c6e7542-c601-0410-84e7-c038aed88b3b
  • Loading branch information
stoecker committed Aug 13, 2024
1 parent c27d31a commit 75a5206
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/org/openstreetmap/josm/io/CachedFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 75a5206

Please sign in to comment.