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/23 17:02:37 UTC
git commit: Android: Expose filePlugin getter so that other plugins
can register filesystems
Updated Branches:
refs/heads/dev 6a0e2a0f4 -> a6575308d
Android: Expose filePlugin getter so that other plugins can register filesystems
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/a6575308
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/tree/a6575308
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/diff/a6575308
Branch: refs/heads/dev
Commit: a6575308dcfe73addfa1a93158cb533268f93ef0
Parents: 6a0e2a0
Author: Ian Clelland <ic...@chromium.org>
Authored: Thu Jan 23 11:02:22 2014 -0500
Committer: Ian Clelland <ic...@chromium.org>
Committed: Thu Jan 23 11:02:22 2014 -0500
----------------------------------------------------------------------
src/android/FileUtils.java | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/a6575308/src/android/FileUtils.java
----------------------------------------------------------------------
diff --git a/src/android/FileUtils.java b/src/android/FileUtils.java
index cfefd53..ac24413 100644
--- a/src/android/FileUtils.java
+++ b/src/android/FileUtils.java
@@ -119,11 +119,15 @@ public class FileUtils extends CordovaPlugin {
// Initialize static plugin reference for deprecated getEntry method
if (filePlugin == null) {
- filePlugin = this;
+ FileUtils.filePlugin = this;
}
}
- private Filesystem filesystemForURL(LocalFilesystemURL localURL) {
+ public static FileUtils getFilePlugin() {
+ return filePlugin;
+ }
+
+ private Filesystem filesystemForURL(LocalFilesystemURL localURL) {
if (localURL == null) return null;
return filesystemForName(localURL.filesystemName);
}
@@ -736,8 +740,8 @@ public class FileUtils extends CordovaPlugin {
public static JSONObject getEntry(File file) throws JSONException {
JSONObject entry;
- if (filePlugin != null) {
- for (Filesystem fs:filePlugin.filesystems) {
+ if (getFilePlugin() != null) {
+ for (Filesystem fs:getFilePlugin().filesystems) {
entry = fs.makeEntryForFile(file);
if (entry != null) {
return entry;