incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From macdo...@apache.org
Subject android commit: CB-438: File metadata.modificationTime returns an invalid date
Date Wed, 04 Apr 2012 17:03:58 GMT
Updated Branches:
  refs/heads/master e213772f9 -> 04aa6d3c3


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/master
Commit: 04aa6d3c38bc53103d0a89b17fd28ad37222c460
Parents: e213772
Author: macdonst <simon.macdonald@gmail.com>
Authored: Wed Apr 4 13:03:39 2012 -0400
Committer: macdonst <simon.macdonald@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();
     }
 
     /**


Mime
View raw message