aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/utils/FileUtils.java
diff options
context:
space:
mode:
authorBananeweizen <bananeweizen@gmx.de>2013-08-19 23:16:44 +0200
committerBananeweizen <bananeweizen@gmx.de>2013-08-19 23:16:44 +0200
commit672b3ca96cfb8273c0eafaa0ed3e1da73244af39 (patch)
tree6be7e17fd7278149ede351ba5aa61b87d0767135 /main/src/cgeo/geocaching/utils/FileUtils.java
parentdbfad2a1987eb3437e69945b2f9f4c75e8abda08 (diff)
downloadcgeo-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.java5
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());
}