We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c84585c commit 7eabe1dCopy full SHA for 7eabe1d
src/org/openstreetmap/josm/io/CachedFile.java
@@ -484,8 +484,10 @@ private File checkLocal(URL url) throws IOException {
484
}
485
486
String a = urlStr.replaceAll("[^A-Za-z0-9_.-]", "_");
487
- if (a.length() > 120) {
488
- a = a.substring(0, 100) + "_" + Utils.md5Hex(urlStr);
+ /* size 11: prefix mirror_ and suffix .tmp */
+ Integer maxFileLength = Config.getPref().getInt("cache.filename.maxlength", 140)-11;
489
+ if (a.length() > maxFileLength) {
490
+ a = a.substring(0, maxFileLength-33) + "_" + Utils.md5Hex(urlStr);
491
492
String localPath = "mirror_" + a;
493
localPath = truncatePath(destDir, localPath);
0 commit comments