diff options
| author | Bananeweizen <bananeweizen@gmx.de> | 2013-08-18 19:08:39 +0200 |
|---|---|---|
| committer | Bananeweizen <bananeweizen@gmx.de> | 2013-08-18 19:08:39 +0200 |
| commit | cd03c1b91da2b5c8cc7eb4f5617263c6aebcbd21 (patch) | |
| tree | cc37d7e3f9f2805992b320169c0e71cf07f6dc1d /main/src/cgeo/geocaching/utils/FileUtils.java | |
| parent | e3bad494f541eb574e80e466ed8abaef8bb5d257 (diff) | |
| download | cgeo-cd03c1b91da2b5c8cc7eb4f5617263c6aebcbd21.zip cgeo-cd03c1b91da2b5c8cc7eb4f5617263c6aebcbd21.tar.gz cgeo-cd03c1b91da2b5c8cc7eb4f5617263c6aebcbd21.tar.bz2 | |
refactoring: more findbugs cleanup
Diffstat (limited to 'main/src/cgeo/geocaching/utils/FileUtils.java')
| -rw-r--r-- | main/src/cgeo/geocaching/utils/FileUtils.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/main/src/cgeo/geocaching/utils/FileUtils.java b/main/src/cgeo/geocaching/utils/FileUtils.java index fec2518..edb8102 100644 --- a/main/src/cgeo/geocaching/utils/FileUtils.java +++ b/main/src/cgeo/geocaching/utils/FileUtils.java @@ -111,4 +111,18 @@ public final class FileUtils { } return success; } + + /** + * Creates the directory named by the given file, creating any missing parent directories in the process. + * + * @return <code>true</code> if the directory was created, <code>false</code> on failure or if the directory already + * existed. + */ + public static boolean mkdirs(File file) { + final boolean success = file.mkdirs(); + if (!success) { + Log.e("Could not make directories " + file.getAbsolutePath()); + } + return success; + } } |
