You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2012/05/12 03:17:18 UTC

[3/3] js commit: removed platform specific override for WP7 filesytem calls

removed platform specific override for WP7 filesytem calls


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

Branch: refs/heads/master
Commit: abc4caa225678df2237933009e103d2198887630
Parents: 5f7fdbd
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Fri May 11 18:14:25 2012 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Fri May 11 18:14:25 2012 -0700

----------------------------------------------------------------------
 lib/wp7/exec.js                                 |    4 +-
 lib/wp7/plugin/wp7/requestFileSystem.js         |   42 ------------------
 lib/wp7/plugin/wp7/resolveLocalFileSystemURI.js |   38 ----------------
 3 files changed, 3 insertions(+), 81 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/abc4caa2/lib/wp7/exec.js
----------------------------------------------------------------------
diff --git a/lib/wp7/exec.js b/lib/wp7/exec.js
index 092543d..a58f013 100644
--- a/lib/wp7/exec.js
+++ b/lib/wp7/exec.js
@@ -21,7 +21,9 @@ var NamedArgs =  {
         write:["fileName","data","position"],
         truncate:["fileName","size"],
         copyTo:["fullPath","parent", "newName"],
-        moveTo:["fullPath","parent", "newName"]
+        moveTo:["fullPath","parent", "newName"],
+        requestFileSystem:["type","size"],
+        resolveLocalFileSystemURI:["uri"]
     },
     FileTransfer:{
         upload:["filePath", "server", "fileKey", "fileName", "mimeType", "params", "debug", "chunkedMode"],

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/abc4caa2/lib/wp7/plugin/wp7/requestFileSystem.js
----------------------------------------------------------------------
diff --git a/lib/wp7/plugin/wp7/requestFileSystem.js b/lib/wp7/plugin/wp7/requestFileSystem.js
deleted file mode 100644
index 2634b16..0000000
--- a/lib/wp7/plugin/wp7/requestFileSystem.js
+++ /dev/null
@@ -1,42 +0,0 @@
-
-var FileError = require('cordova/plugin/FileError'),
-    FileSystem = require('cordova/plugin/FileSystem'),
-    exec = require('cordova/exec');
-
-/**
- * Request a file system in which to store application data.
- * @param type  local file system type
- * @param size  indicates how much storage space, in bytes, the application expects to need
- * @param successCallback  invoked with a FileSystem object
- * @param errorCallback  invoked if error occurs retrieving file system
- */
-var requestFileSystem = function(type, size, successCallback, errorCallback) {
-    // wp7 custom imp
-    var fail = function(code) {
-        if (typeof errorCallback === 'function') {
-            errorCallback(new FileError(code));
-        }
-    };
-
-    if (type < 0 || type > 3) {
-        fail(FileError.SYNTAX_ERR);
-    } else {
-        // if successful, return a FileSystem object
-        var success = function(file_system) {
-            if (file_system) {
-                if (typeof successCallback === 'function') {
-                    // grab the name and root from the file system object
-                    var result = new FileSystem(file_system.name, file_system.root);
-                    successCallback(result);
-                }
-            }
-            else {
-                // no FileSystem object returned
-                fail(FileError.NOT_FOUND_ERR);
-            }
-        };
-        exec(success, fail, "File", "requestFileSystem", {type:type,size:size});
-    }
-};
-
-module.exports = requestFileSystem;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/abc4caa2/lib/wp7/plugin/wp7/resolveLocalFileSystemURI.js
----------------------------------------------------------------------
diff --git a/lib/wp7/plugin/wp7/resolveLocalFileSystemURI.js b/lib/wp7/plugin/wp7/resolveLocalFileSystemURI.js
deleted file mode 100644
index 32d591d..0000000
--- a/lib/wp7/plugin/wp7/resolveLocalFileSystemURI.js
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-var DirectoryEntry = require('cordova/plugin/DirectoryEntry'),
-    FileEntry = require('cordova/plugin/FileEntry'),
-    FileError = require('cordova/plugin/FileError'),
-    exec = require('cordova/exec');
-
-module.exports = function(uri, successCallback, errorCallback) {
-    // error callback
-    var fail = function(error) {
-        if (typeof errorCallback === 'function') {
-            errorCallback(new FileError(error));
-        }
-    };
-    // if successful, return either a file or directory entry
-    var success = function(entry) {
-        var result;
-
-        if (entry) {
-            if (typeof successCallback === 'function') {
-                // create appropriate Entry object
-                result = (entry.isDirectory) ? new DirectoryEntry(entry.name, entry.fullPath) : new FileEntry(entry.name, entry.fullPath);
-                try {
-                    successCallback(result);
-                }
-                catch (e) {
-                    console.log('Error invoking callback: ' + e);
-                }
-            }
-        }
-        else {
-            // no Entry object returned
-            fail(FileError.NOT_FOUND_ERR);
-        }
-    };
-
-    exec(success, fail, "File", "resolveLocalFileSystemURI", {uri:uri});
-};