incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bcur...@apache.org
Subject [2/2] android commit: File APIs should return error code instead of object.
Date Wed, 29 Feb 2012 04:32:46 GMT
File APIs should return error code instead of object.


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/commit/f6503f84
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/tree/f6503f84
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/diff/f6503f84

Branch: refs/heads/master
Commit: f6503f8476bbdcaf600b09ec1ff8126de9b75960
Parents: d593448
Author: Bryce Curtis <curtis.bryce@gmail.com>
Authored: Tue Feb 28 22:30:27 2012 -0600
Committer: Bryce Curtis <curtis.bryce@gmail.com>
Committed: Tue Feb 28 22:30:27 2012 -0600

----------------------------------------------------------------------
 framework/src/org/apache/cordova/FileUtils.java |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/f6503f84/framework/src/org/apache/cordova/FileUtils.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/FileUtils.java b/framework/src/org/apache/cordova/FileUtils.java
index f2cc980..7dc26f3 100755
--- a/framework/src/org/apache/cordova/FileUtils.java
+++ b/framework/src/org/apache/cordova/FileUtils.java
@@ -131,8 +131,7 @@ public class FileUtils extends Plugin {
                 long size = args.optLong(1);
                 if (size != 0) {
                     if (size > (DirectoryManager.getFreeDiskSpace(true)*1024)) {
-                        JSONObject error = new JSONObject().put("code", FileUtils.QUOTA_EXCEEDED_ERR);
-                        return new PluginResult(PluginResult.Status.ERROR, error);
+                        return new PluginResult(PluginResult.Status.ERROR, FileUtils.QUOTA_EXCEEDED_ERR);
                     }
                 }
                 JSONObject obj = requestFileSystem(args.getInt(0));
@@ -171,8 +170,7 @@ public class FileUtils extends Plugin {
                     notifyDelete(args.getString(0));
                     return new PluginResult(status);
                 } else {
-                    JSONObject error = new JSONObject().put("code", FileUtils.NO_MODIFICATION_ALLOWED_ERR);
-                    return new PluginResult(PluginResult.Status.ERROR, error);
+                    return new PluginResult(PluginResult.Status.ERROR, FileUtils.NO_MODIFICATION_ALLOWED_ERR);
                 }
             }
             else if (action.equals("removeRecursively")) {
@@ -180,8 +178,7 @@ public class FileUtils extends Plugin {
                 if (success) {
                     return new PluginResult(status);
                 } else {
-                    JSONObject error = new JSONObject().put("code", FileUtils.NO_MODIFICATION_ALLOWED_ERR);
-                    return new PluginResult(PluginResult.Status.ERROR, error);
+                    return new PluginResult(PluginResult.Status.ERROR, FileUtils.NO_MODIFICATION_ALLOWED_ERR);
                 }
             }
             else if (action.equals("moveTo")) {


Mime
View raw message