cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lorinb...@apache.org
Subject webworks commit: [CB-2809] resolveFileSystemURI now reports native IllegalArgument exception, getEntryFromURI now handles query strings
Date Wed, 27 Mar 2013 15:01:55 GMT
Updated Branches:
  refs/heads/master e50fcd5ad -> f3ee54cd3


[CB-2809] resolveFileSystemURI now reports native IllegalArgument exception, getEntryFromURI
now handles query strings


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

Branch: refs/heads/master
Commit: f3ee54cd3558d709f409710672213de2b60c61b5
Parents: e50fcd5
Author: lorinbeer <lorin@adobe.com>
Authored: Wed Mar 27 08:00:12 2013 -0700
Committer: lorinbeer <lorin@adobe.com>
Committed: Wed Mar 27 08:00:12 2013 -0700

----------------------------------------------------------------------
 .../src/org/apache/cordova/file/FileManager.java   |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/f3ee54cd/framework/ext/src/org/apache/cordova/file/FileManager.java
----------------------------------------------------------------------
diff --git a/framework/ext/src/org/apache/cordova/file/FileManager.java b/framework/ext/src/org/apache/cordova/file/FileManager.java
index e0c3556..55ea436 100644
--- a/framework/ext/src/org/apache/cordova/file/FileManager.java
+++ b/framework/ext/src/org/apache/cordova/file/FileManager.java
@@ -96,7 +96,6 @@ public class FileManager extends Plugin {
      * @return A PluginResult object with a status and message.
      */
     public PluginResult execute(String action, JSONArray args, String callbackId) {
-
         // perform specified action
         if (ACTION_READ_AS_TEXT.equals(action)) {
             // get file path
@@ -547,11 +546,11 @@ public class FileManager extends Plugin {
     protected static PluginResult resolveFileSystemURI(String uri) {
         PluginResult result = null;
         Entry entry = null;
-
         try {
             entry = getEntryFromURI(uri);
         }
         catch (IllegalArgumentException e) {
+            Logger.log(e.toString());
             return new PluginResult(
                     PluginResult.Status.JSON_EXCEPTION,
                     ENCODING_ERR);
@@ -565,6 +564,7 @@ public class FileManager extends Plugin {
             result = new PluginResult(PluginResult.Status.OK,
                     entry.toJSONObject());
         }
+
         return result;
     }
 
@@ -889,6 +889,13 @@ public class FileManager extends Plugin {
             throw new IllegalArgumentException("Invalid URI.");
         }
 
+        //check for query string
+        int queryIndex = filePath.indexOf('?');
+        if (queryIndex > 0) {
+            path = filePath.substring(0, queryIndex); // discard the query string
+            Logger.log(FileManager.class.getName() + ": found query string when resolving
URI = " + filePath.substring(queryIndex));
+        }
+
         // create a file system entry
         Entry entry = null;
         if (path.startsWith(FileUtils.LOCAL_PROTOCOL)) {


Mime
View raw message