You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ia...@apache.org on 2014/01/28 17:46:55 UTC
git commit: CB-5916: Create documents directories if they don't exist
Updated Branches:
refs/heads/dev d5478e561 -> 620bb7cd8
CB-5916: Create documents directories if they don't exist
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/commit/620bb7cd
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/tree/620bb7cd
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/diff/620bb7cd
Branch: refs/heads/dev
Commit: 620bb7cd8b47fe67e71e96eaaffa56831b577def
Parents: d5478e5
Author: Ian Clelland <ic...@chromium.org>
Authored: Tue Jan 28 11:46:39 2014 -0500
Committer: Ian Clelland <ic...@chromium.org>
Committed: Tue Jan 28 11:46:39 2014 -0500
----------------------------------------------------------------------
src/android/FileUtils.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/620bb7cd/src/android/FileUtils.java
----------------------------------------------------------------------
diff --git a/src/android/FileUtils.java b/src/android/FileUtils.java
index 415d0e2..cc5e8c0 100644
--- a/src/android/FileUtils.java
+++ b/src/android/FileUtils.java
@@ -118,7 +118,6 @@ public class FileUtils extends CordovaPlugin {
* plugin can continue to provide access to files stored under those
* versions.
*/
- File fp;
if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
persistentRoot = Environment.getExternalStorageDirectory().getAbsolutePath();
tempRoot = Environment.getExternalStorageDirectory().getAbsolutePath() +
@@ -127,10 +126,11 @@ public class FileUtils extends CordovaPlugin {
persistentRoot = "/data/data/" + packageName;
tempRoot = "/data/data/" + packageName + "/cache/";
}
- // Create the cache dir if it doesn't exist.
- fp = new File(tempRoot);
- fp.mkdirs();
}
+ // Create the directories if they don't exist.
+ new File(tempRoot).mkdirs();
+ new File(persistentRoot).mkdirs();
+
// Register initial filesystems
// Note: The temporary and persistent filesystems need to be the first two
// registered, so that they will match window.TEMPORARY and window.PERSISTENT,