diff --git a/src/org/openstreetmap/josm/data/cache/JCSCacheManager.java b/src/org/openstreetmap/josm/data/cache/JCSCacheManager.java
index 260c35e..d127f45 100644
a
|
b
|
public final class JCSCacheManager {
|
240 | 240 | } |
241 | 241 | |
242 | 242 | private static void deleteCacheFiles(String basePathPart) { |
243 | | Utils.deleteFile(new File(basePathPart + ".key")); |
244 | | Utils.deleteFile(new File(basePathPart + ".data")); |
| 243 | Utils.deleteFileIfExists(new File(basePathPart + ".key")); |
| 244 | Utils.deleteFileIfExists(new File(basePathPart + ".data")); |
245 | 245 | } |
246 | 246 | |
247 | 247 | private static CompositeCacheAttributes getCacheAttributes(int maxMemoryElements) { |
diff --git a/src/org/openstreetmap/josm/tools/Utils.java b/src/org/openstreetmap/josm/tools/Utils.java
index bc151aa..6c194d1 100644
a
|
b
|
public final class Utils {
|
491 | 491 | } |
492 | 492 | |
493 | 493 | /** |
| 494 | * Deletes a file and log a default warning if the file exists but the deletion fails. |
| 495 | * @param file file to delete |
| 496 | * @return {@code true} if and only if the file does not exist or is successfully deleted; {@code false} otherwise |
| 497 | * @since xxx |
| 498 | */ |
| 499 | public static boolean deleteFileIfExists(File file) { |
| 500 | if (file.exists()) { |
| 501 | return deleteFile(file); |
| 502 | } else { |
| 503 | return true; |
| 504 | } |
| 505 | } |
| 506 | |
| 507 | /** |
494 | 508 | * Deletes a file and log a default warning if the deletion fails. |
495 | 509 | * @param file file to delete |
496 | 510 | * @return {@code true} if and only if the file is successfully deleted; {@code false} otherwise |