diff options
| author | Bananeweizen <bananeweizen@gmx.de> | 2013-08-19 23:16:44 +0200 |
|---|---|---|
| committer | Bananeweizen <bananeweizen@gmx.de> | 2013-08-19 23:16:44 +0200 |
| commit | 672b3ca96cfb8273c0eafaa0ed3e1da73244af39 (patch) | |
| tree | 6be7e17fd7278149ede351ba5aa61b87d0767135 /main/src/cgeo/geocaching/utils/FileUtils.java | |
| parent | dbfad2a1987eb3437e69945b2f9f4c75e8abda08 (diff) | |
| download | cgeo-672b3ca96cfb8273c0eafaa0ed3e1da73244af39.zip cgeo-672b3ca96cfb8273c0eafaa0ed3e1da73244af39.tar.gz cgeo-672b3ca96cfb8273c0eafaa0ed3e1da73244af39.tar.bz2 | |
fix #3145: Directory creation error logs
Diffstat (limited to 'main/src/cgeo/geocaching/utils/FileUtils.java')
| -rw-r--r-- | main/src/cgeo/geocaching/utils/FileUtils.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/main/src/cgeo/geocaching/utils/FileUtils.java b/main/src/cgeo/geocaching/utils/FileUtils.java index c3eacac..f650216 100644 --- a/main/src/cgeo/geocaching/utils/FileUtils.java +++ b/main/src/cgeo/geocaching/utils/FileUtils.java @@ -94,7 +94,8 @@ public final class FileUtils { * This usage of this method indicates that the return value of File.delete() can safely be ignored. */ public static void deleteIgnoringFailure(final File file) { - if (!file.delete()) { + final boolean success = file.delete() || !file.exists(); + if (!success) { Log.i("Could not delete " + file.getAbsolutePath()); } } @@ -105,7 +106,7 @@ public final class FileUtils { * @return <code> true</code> if this file was deleted, <code>false</code> otherwise. */ public static boolean delete(final File file) { - final boolean success = file.delete(); + final boolean success = file.delete() || !file.exists(); if (!success) { Log.e("Could not delete " + file.getAbsolutePath()); } |
