You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by bo...@apache.org on 2012/04/04 22:38:53 UTC
[2/16] android commit: CB-438: File metadata.modificationTime returns
an invalid date
CB-438: File metadata.modificationTime returns an invalid date
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/04aa6d3c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/tree/04aa6d3c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/diff/04aa6d3c
Branch: refs/heads/CordovaWebView
Commit: 04aa6d3c38bc53103d0a89b17fd28ad37222c460
Parents: e213772
Author: macdonst <si...@gmail.com>
Authored: Wed Apr 4 13:03:39 2012 -0400
Committer: macdonst <si...@gmail.com>
Committed: Wed Apr 4 13:03:39 2012 -0400
----------------------------------------------------------------------
framework/src/org/apache/cordova/FileUtils.java | 13 ++++---------
1 files changed, 4 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/04aa6d3c/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 9334543..b2aa990 100755
--- a/framework/src/org/apache/cordova/FileUtils.java
+++ b/framework/src/org/apache/cordova/FileUtils.java
@@ -142,8 +142,7 @@ public class FileUtils extends Plugin {
return new PluginResult(status, obj);
}
else if (action.equals("getMetadata")) {
- JSONObject obj = getMetadata(args.getString(0));
- return new PluginResult(status, obj);
+ return new PluginResult(status, getMetadata(args.getString(0)));
}
else if (action.equals("getFileMetadata")) {
JSONObject obj = getFileMetadata(args.getString(0));
@@ -764,21 +763,17 @@ public class FileUtils extends Plugin {
* Look up metadata about this entry.
*
* @param filePath to entry
- * @return a Metadata object
+ * @return a long
* @throws FileNotFoundException
- * @throws JSONException
*/
- private JSONObject getMetadata(String filePath) throws FileNotFoundException, JSONException {
+ private long getMetadata(String filePath) throws FileNotFoundException {
File file = createFileObject(filePath);
if (!file.exists()) {
throw new FileNotFoundException("Failed to find file in getMetadata");
}
- JSONObject metadata = new JSONObject();
- metadata.put("modificationTime", file.lastModified());
-
- return metadata;
+ return file.lastModified();
}
/**