From 04aa6d3c38bc53103d0a89b17fd28ad37222c460 Mon Sep 17 00:00:00 2001 From: macdonst Date: Wed, 4 Apr 2012 13:03:39 -0400 Subject: [PATCH] CB-438: File metadata.modificationTime returns an invalid date --- framework/src/org/apache/cordova/FileUtils.java | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/framework/src/org/apache/cordova/FileUtils.java b/framework/src/org/apache/cordova/FileUtils.java index 9334543c..b2aa990d 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(); } /**