You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by bc...@apache.org on 2012/02/17 23:58:02 UTC
[7/16] android commit: truncating file:// protocol where applicable
in metadata func
truncating file:// protocol where applicable in metadata func
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/0ba803ff
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/tree/0ba803ff
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/diff/0ba803ff
Branch: refs/heads/master
Commit: 0ba803ff46fd577913040e67dc83125889382921
Parents: 6c48c6a
Author: Fil Maj <fi...@nitobi.com>
Authored: Thu Feb 16 17:21:03 2012 -0800
Committer: Fil Maj <fi...@nitobi.com>
Committed: Thu Feb 16 17:21:03 2012 -0800
----------------------------------------------------------------------
framework/src/org/apache/cordova/FileUtils.java | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/0ba803ff/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 ec81fc7..3646be6 100755
--- a/framework/src/org/apache/cordova/FileUtils.java
+++ b/framework/src/org/apache/cordova/FileUtils.java
@@ -755,6 +755,9 @@ public class FileUtils extends Plugin {
* @throws JSONException
*/
private JSONObject getFileMetadata(String filePath) throws FileNotFoundException, JSONException {
+ if (filePath.startsWith("file://")) {
+ filePath = filePath.substring(7);
+ }
File file = new File(filePath);
if (!file.exists()) {