Ignore:
Timestamp:
2016-07-20T09:05:23+02:00 (7 years ago)
Author:
Don-vip
Message:

fix #13171 - Do not complain for non-existent files during cache cleanup (patch by michael2402) - gsoc-core

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/Utils.java

    r10404 r10570  
    492492
    493493    /**
     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 10569
     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    /**
    494508     * Deletes a file and log a default warning if the deletion fails.
    495509     * @param file file to delete
Note: See TracChangeset for help on using the changeset viewer.