cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject [32/50] git commit: Android: Expose filePlugin getter so that other plugins can register filesystems
Date Mon, 10 Feb 2014 23:22:58 GMT
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/master
Commit: a6575308dcfe73addfa1a93158cb533268f93ef0
Parents: 6a0e2a0
Author: Ian Clelland <iclelland@chromium.org>
Authored: Thu Jan 23 11:02:22 2014 -0500
Committer: Ian Clelland <iclelland@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;


Mime
View raw message