diff options
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; + } } |
