You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by bh...@apache.org on 2014/05/08 21:18:26 UTC

[1/2] CB-3440 [BlackBerry10] Proxy based implementation

Repository: cordova-plugin-file
Updated Branches:
  refs/heads/master e2a118d26 -> bff46b6fc


http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/bff46b6f/www/blackberry10/requestFileSystem.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/requestFileSystem.js b/www/blackberry10/requestFileSystem.js
index 9180801..de5de23 100644
--- a/www/blackberry10/requestFileSystem.js
+++ b/www/blackberry10/requestFileSystem.js
@@ -19,41 +19,35 @@
  *
 */
 
-var fileUtils = require('./BB10Utils'),
-    FileError = require('./FileError'),
-    FileSystem = require('./BB10FileSystem');
-
-if (!window.requestAnimationFrame) {
-    window.requestAnimationFrame = function (callback) { callback(); };
-}
+/* 
+ * requestFileSystem
+ *
+ * IN:
+ *  args 
+ *   0 - type (TEMPORARY = 0, PERSISTENT = 1)
+ *   1 - size
+ * OUT:
+ *  success - FileSystem object
+ *   - name - the human readable directory name
+ *   - root - DirectoryEntry object
+ *      - isDirectory
+ *      - isFile
+ *      - name
+ *      - fullPath
+ *  fail - FileError code
+ */
 
-module.exports = function (type, size, success, fail) {
-    var cordovaFs,
-        cordovaFsRoot;
-    if (size >= 1000000000000000) {
-        if (typeof fail === "function") {
-            fail(new FileError(FileError.QUOTA_EXCEEDED_ERR));
-        }
-    } else if (type !== 1 && type !== 0) {
-        if (typeof fail === "function") {
-            fail(new FileError(FileError.SYNTAX_ERR));
-        }
-    } else {
-        cordova.exec(function () {
-            window.requestAnimationFrame(function () {
-                window.webkitRequestFileSystem(type, size, function (fs) {
-                    cordovaFsRoot = fileUtils.createEntry(fs.root);
-                    cordovaFs = new FileSystem(fileUtils.getFileSystemName(fs), cordovaFsRoot);
-                    cordovaFsRoot.filesystem = cordovaFs;
-                    cordovaFs._size = size;
-                    success(cordovaFs);
-                }, function (error) {
-                    if (typeof fail === "function") {
-                        fail(new FileError(error));
-                    }
-                });
-            });
-        }, fail, "org.apache.cordova.file", "setSandbox", [true]);
+var resolve = cordova.require('org.apache.cordova.file.resolveLocalFileSystemURIProxy');
 
-    }
+module.exports = function (success, fail, args) {
+    var fsType = args[0] === 0 ? 'temporary' : 'persistent',
+        size = args[1],
+        onSuccess = function (fs) {
+            var directory = {
+                name: fsType,
+                root: fs
+            };
+            success(directory);
+        };
+    resolve(onSuccess, fail, ['cdvfile://localhost/' + fsType + '/', undefined, size]);
 };

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/bff46b6f/www/blackberry10/resolveLocalFileSystemURI.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/resolveLocalFileSystemURI.js b/www/blackberry10/resolveLocalFileSystemURI.js
index 6decdda..a29fe2f 100644
--- a/www/blackberry10/resolveLocalFileSystemURI.js
+++ b/www/blackberry10/resolveLocalFileSystemURI.js
@@ -19,7 +19,154 @@
  *
 */
 
-module.exports = function () {
-    console.log("resolveLocalFileSystemURI is deprecated. Please call resolveLocalFileSystemURL instead.");
-    window.resolveLocalFileSystemURL.apply(this, arguments);
+/*
+ * resolveLocalFileSystemURI
+ *
+ * IN
+ *  args
+ *   0 - escaped local filesystem URI
+ *   1 - options (standard HTML5 file system options)
+ *   2 - size
+ * OUT
+ *  success - Entry object
+ *   - isDirectory
+ *   - isFile
+ *   - name
+ *   - fullPath
+ *   - nativeURL
+ *   - fileSystemName
+ *  fail - FileError code
+ */
+
+var info = require('org.apache.cordova.file.bb10FileSystemInfo'),
+    requestAnimationFrame = cordova.require('org.apache.cordova.file.bb10RequestAnimationFrame'),
+    createEntryFromNative = require('org.apache.cordova.file.bb10CreateEntryFromNative'),
+    SANDBOXED = true,
+    UNSANDBOXED = false;
+
+module.exports = function (success, fail, args) {
+    var request = args[0],
+        options = args[1],
+        size = args[2];
+    if (request) {
+        request = decodeURIComponent(request);
+        if (request.indexOf('?') > -1) {
+            //bb10 does not support params; strip them off
+            request = request.substring(0, request.indexOf('?'));
+        }
+        if (request.indexOf('file://localhost/') === 0) {
+            //remove localhost prefix
+            request = request.replace('file://localhost/', 'file:///');
+        }
+        //requests to sandboxed locations should use cdvfile
+        request = request.replace(info.persistentPath, 'cdvfile://localhost/persistent');
+        request = request.replace(info.temporaryPath, 'cdvfile://localhost/temporary');
+        //pick appropriate handler
+        if (request.indexOf('file:///') === 0) {
+            resolveFile(success, fail, request, options);
+        } else if (request.indexOf('cdvfile://localhost/') === 0) {
+            resolveCdvFile(success, fail, request, options, size);
+        } else if (request.indexOf('local:///') === 0) {
+            resolveLocal(success, fail, request, options);
+        } else {
+            fail(FileError.ENCODING_ERR);
+        }
+    } else {
+        fail(FileError.NOT_FOUND_ERR);
+    }
 };
+
+//resolve file:///
+function resolveFile(success, fail, request, options) {
+    var path = request.substring(7);
+    resolve(success, fail, path, window.PERSISTENT, UNSANDBOXED, options);
+}
+
+//resolve cdvfile://localhost/filesystemname/
+function resolveCdvFile(success, fail, request, options, size) {
+    var components = /cdvfile:\/\/localhost\/([^\/]+)\/(.*)/.exec(request),
+        fsType = components[1],
+        path = components[2];
+    if (fsType === 'persistent') {
+        resolve(success, fail, path, window.PERSISTENT, SANDBOXED, options, size);
+    }
+    else if (fsType === 'temporary') {
+        resolve(success, fail, path, window.TEMPORARY, SANDBOXED, options, size);
+    }
+    else if (fsType === 'root') {
+        resolve(success, fail, path, window.PERSISTENT, UNSANDBOXED, options);
+    }
+    else {
+        fail(FileError.NOT_FOUND_ERR);
+    }
+}
+
+//resolve local:///
+function resolveLocal(success, fail, request, options) {
+    var path = localPath + request.substring(8);
+    resolve(success, fail, path, window.PERSISTENT, UNSANDBOXED, options);
+}
+
+//validate parameters and set sandbox
+function resolve(success, fail, path, fsType, sandbox, options, size) {
+    options = options || { create: false };
+    size = size || 0;
+    if (size > info.MAX_SIZE) {
+        //bb10 does not respect quota; fail at unreasonably large size
+        fail(FileError.QUOTA_EXCEEDED_ERR);
+    } else if (path.indexOf(':') > -1) {
+        //files with : character are not valid in Cordova apps 
+        fail(FileError.ENCODING_ERR);
+    } else {
+        requestAnimationFrame(function () {
+            cordova.exec(function () {
+                requestAnimationFrame(function () {
+                    resolveNative(success, fail, path, fsType, options, size);
+                });
+            }, fail, 'org.apache.cordova.file', 'setSandbox', [sandbox], false);
+        });
+    }
+}
+
+//find path using webkit file system
+function resolveNative(success, fail, path, fsType, options, size) {
+    window.webkitRequestFileSystem(
+        fsType,
+        size,
+        function (fs) {
+            if (path === '') {
+                //no path provided, call success with root file system
+                success(createEntryFromNative(fs.root));
+            } else {
+                //otherwise attempt to resolve as file
+                fs.root.getFile(
+                    path,
+                    options,
+                    function (entry) {
+                        success(createEntryFromNative(entry));
+                    },
+                    function (fileError) {
+                        //file not found, attempt to resolve as directory
+                        fs.root.getDirectory(
+                            path,
+                            options,
+                            function (entry) {
+                                success(createEntryFromNative(entry));
+                            },
+                            function (dirError) {
+                                //path cannot be resolved
+                                if (fileError.code === FileError.INVALID_MODIFICATION_ERR && 
+                                    options.exclusive) {
+                                    //mobile-spec expects this error code
+                                    fail(FileError.PATH_EXISTS_ERR);
+                                } else {
+                                    fail(FileError.NOT_FOUND_ERR);
+                                }
+                            }
+                        );
+                    }
+                );
+            }
+        }
+    );
+}

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/bff46b6f/www/blackberry10/resolveLocalFileSystemURL.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/resolveLocalFileSystemURL.js b/www/blackberry10/resolveLocalFileSystemURL.js
deleted file mode 100644
index db64615..0000000
--- a/www/blackberry10/resolveLocalFileSystemURL.js
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var fileUtils = require('./BB10Utils'),
-    FileError = require('./FileError');
-
-if (!window.requestAnimationFrame) {
-    window.requestAnimationFrame = function (callback) { callback(); };
-}
-
-module.exports = function (uri, success, fail) {
-
-    var decodedURI = decodeURI(uri).replace(/filesystem:/, '').replace(/file:\/\//, ''),
-        failNotFound = function () {
-            if (fail) {
-                fail(FileError.NOT_FOUND_ERR);
-            }
-        },
-        resolveURI = function () {
-            window.requestAnimationFrame(function () {
-                window.webkitRequestFileSystem(
-                    window.PERSISTENT,
-                    50*1024*1024,
-                    function (fs) {
-                        var op = decodedURI.slice(-1) === '/' ? 'getDirectory' : 'getFile';
-                        fs.root[op](
-                            decodedURI,
-                            { create: false },
-                            function (entry) {
-                                success(fileUtils.createEntry(entry));
-                            },
-                            failNotFound
-                        );
-                    },
-                    failNotFound
-                );
-            });
-        };
-
-    if (decodedURI.substring(0, 8) === 'local://') {
-        cordova.exec(
-            function (path) {
-                decodedURI = path;
-                resolveURI();
-            },
-            failNotFound,
-            'org.apache.cordova.file',
-            'resolveLocalPath',
-            [decodedURI]
-        );
-    } else {
-        cordova.exec(
-            resolveURI, 
-            failNotFound, 
-            'org.apache.cordova.file', 
-            'setSandbox', 
-            [!fileUtils.isOutsideSandbox(decodedURI)]
-        );
-    }
-};

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/bff46b6f/www/blackberry10/setMetadata.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/setMetadata.js b/www/blackberry10/setMetadata.js
new file mode 100644
index 0000000..0f2dc79
--- /dev/null
+++ b/www/blackberry10/setMetadata.js
@@ -0,0 +1,33 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+/* 
+ * setMetadata
+ * 
+ * BB10 OS does not support setting file metadata via HTML5 File System 
+ */
+
+module.exports = function (success, fail, args) {
+    console.error("setMetadata not supported on BB10", arguments);
+    if (typeof(fail) === 'function') {
+        fail();
+    }
+};

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/bff46b6f/www/blackberry10/truncate.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/truncate.js b/www/blackberry10/truncate.js
new file mode 100644
index 0000000..d93e17f
--- /dev/null
+++ b/www/blackberry10/truncate.js
@@ -0,0 +1,74 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+/* 
+ * truncate
+ * 
+ * IN:
+ *  args
+ *   0 - URL of file to truncate
+ *   1 - start position
+ * OUT:
+ *  success - new length of file
+ *  fail - FileError
+ */
+
+var resolve = cordova.require('org.apache.cordova.file.resolveLocalFileSystemURIProxy'),
+    requestAnimationFrame = cordova.require('org.apache.cordova.file.bb10RequestAnimationFrame');
+
+module.exports = function (success, fail, args) {
+    var uri = args[0],
+        length = args[1],
+        onSuccess = function (data) {
+            if (typeof success === 'function') {
+                success(data.loaded);
+            }
+        },
+        onFail = function (error) {
+            if (typeof fail === 'function') {
+                if (error && error.code) {
+                    fail(error.code);
+                } else {
+                    fail(error);
+                }
+            }
+        };
+    resolve(function (fs) {
+        requestAnimationFrame(function () {
+            fs.nativeEntry.file(function (file) {
+                var reader = new FileReader()._realReader;
+                reader.onloadend = function () {
+                    var contents = new Uint8Array(this.result).subarray(0, length);
+                        blob = new Blob([contents]);
+                    window.requestAnimationFrame(function () {
+                        fs.nativeEntry.createWriter(function (fileWriter) {
+                            fileWriter.onwriteend = onSuccess;
+                            fileWriter.onerror = onFail;
+                            fileWriter.write(blob);
+                        }, onFail);
+                    });
+                };
+                reader.onerror = onFail;
+                reader.readAsArrayBuffer(file);
+            }, onFail);
+        });
+    }, onFail, [uri]);
+};

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/bff46b6f/www/blackberry10/write.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/write.js b/www/blackberry10/write.js
new file mode 100644
index 0000000..1b31bb2
--- /dev/null
+++ b/www/blackberry10/write.js
@@ -0,0 +1,71 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+/* 
+ * write
+ * 
+ * IN:
+ *  args
+ *   0 - URL of file to write
+ *   1 - data to write
+ *   2 - offset
+ *   3 - isBinary
+ * OUT:
+ *  success - bytes written
+ *  fail - FileError
+ */
+
+var resolve = cordova.require('org.apache.cordova.file.resolveLocalFileSystemURIProxy'),
+    requestAnimationFrame = cordova.require('org.apache.cordova.file.bb10RequestAnimationFrame');
+
+module.exports = function (success, fail, args) {
+    var uri = args[0],
+        data = args[1],
+        offset = args[2],
+        isBinary = args[3],
+        onSuccess = function (data) {
+            if (typeof success === 'function') {
+                success(data.loaded);
+            }
+        },
+        onFail = function (error) {
+            if (typeof fail === 'function') {
+                if (error && error.code) {
+                    fail(error.code);
+                } else {
+                    fail(error);
+                }
+            }
+        };
+    resolve(function (fs) {
+        requestAnimationFrame(function () {
+            fs.nativeEntry.createWriter(function (writer) {
+                var blob = new Blob([data]);
+                if (offset) {
+                    writer.seek(offset);
+                }
+                writer.onwriteend = onSuccess;
+                writer.onerror = onFail;
+                writer.write(blob);
+            }, onFail);
+        });
+    }, fail, [uri, { create: true }]);
+};

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/bff46b6f/www/fileSystems-roots.js
----------------------------------------------------------------------
diff --git a/www/fileSystems-roots.js b/www/fileSystems-roots.js
index 81c2277..ff77d94 100644
--- a/www/fileSystems-roots.js
+++ b/www/fileSystems-roots.js
@@ -24,7 +24,7 @@ var fsMap = null;
 var FileSystem = require('./FileSystem');
 var exec = require('cordova/exec');
 
-// Overridden by iOS & Android to populate fsMap.
+// Overridden by Android, BlackBerry 10 and iOS to populate fsMap.
 require('./fileSystems').getFs = function(name, callback) {
     if (fsMap) {
         callback(fsMap[name]);

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/bff46b6f/www/fileSystems.js
----------------------------------------------------------------------
diff --git a/www/fileSystems.js b/www/fileSystems.js
index 725af73..8ecdec3 100644
--- a/www/fileSystems.js
+++ b/www/fileSystems.js
@@ -19,7 +19,7 @@
  *
 */
 
-// Overridden by iOS & Android to populate fsMap.
+// Overridden by Android, BlackBerry 10 and iOS to populate fsMap.
 module.exports.getFs = function(name, callback) {
     callback(null);
 };


[2/2] git commit: CB-3440 [BlackBerry10] Proxy based implementation

Posted by bh...@apache.org.
CB-3440 [BlackBerry10] Proxy based implementation

This is a re-write of the file plugin for BB10. Rather than clobbering the
window objects this utilizes the exec proxy to handle requests from common
JS in the content webview. All operations are handled by the webkit HTML5
file system API. The setSandbox function in index.js allows the file system
to be toggled between full device filesystem access and the app's local
sandbox.


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/commit/bff46b6f
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/tree/bff46b6f
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/diff/bff46b6f

Branch: refs/heads/master
Commit: bff46b6fc5bd454a07dc76da599b9de23da43b55
Parents: e2a118d
Author: Bryan Higgins <bh...@blackberry.com>
Authored: Sat Mar 29 18:57:27 2014 -0400
Committer: Bryan Higgins <bh...@blackberry.com>
Committed: Thu May 8 15:15:43 2014 -0400

----------------------------------------------------------------------
 doc/index.md                                  |  13 +-
 plugin.xml                                    |  62 +++++----
 src/blackberry10/index.js                     |  12 +-
 www/blackberry10/DirectoryEntry.js            | 119 ----------------
 www/blackberry10/DirectoryReader.js           |  54 --------
 www/blackberry10/Entry.js                     | 116 ----------------
 www/blackberry10/File.js                      |  56 --------
 www/blackberry10/FileEntry.js                 |  49 -------
 www/blackberry10/FileProxy.js                 |  51 +++++++
 www/blackberry10/FileReader.js                |  90 ------------
 www/blackberry10/FileSystem.js                |  27 +++-
 www/blackberry10/FileWriter.js                | 120 ----------------
 www/blackberry10/copyTo.js                    | 135 ++++++++++++++++++
 www/blackberry10/createEntryFromNative.js     |  72 ++++++++++
 www/blackberry10/fileUtils.js                 |  52 -------
 www/blackberry10/getDirectory.js              |  72 ++++++++++
 www/blackberry10/getFile.js                   |  57 ++++++++
 www/blackberry10/getFileMetadata.js           |  61 ++++++++
 www/blackberry10/getMetadata.js               |  54 ++++++++
 www/blackberry10/getParent.js                 |  57 ++++++++
 www/blackberry10/info.js                      |  52 +++++++
 www/blackberry10/moveTo.js                    |  39 ++++++
 www/blackberry10/readAsArrayBuffer.js         |  68 +++++++++
 www/blackberry10/readAsBinaryString.js        |  68 +++++++++
 www/blackberry10/readAsDataURL.js             |  65 +++++++++
 www/blackberry10/readAsText.js                |  77 +++++++++++
 www/blackberry10/readEntries.js               |  71 ++++++++++
 www/blackberry10/remove.js                    |  61 ++++++++
 www/blackberry10/removeRecursively.js         |  62 +++++++++
 www/blackberry10/requestAllFileSystems.js     |  42 ++++++
 www/blackberry10/requestAnimationFrame.js     |  38 +++++
 www/blackberry10/requestFileSystem.js         |  64 ++++-----
 www/blackberry10/resolveLocalFileSystemURI.js | 153 ++++++++++++++++++++-
 www/blackberry10/resolveLocalFileSystemURL.js |  78 -----------
 www/blackberry10/setMetadata.js               |  33 +++++
 www/blackberry10/truncate.js                  |  74 ++++++++++
 www/blackberry10/write.js                     |  71 ++++++++++
 www/fileSystems-roots.js                      |   2 +-
 www/fileSystems.js                            |   2 +-
 39 files changed, 1621 insertions(+), 828 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/bff46b6f/doc/index.md
----------------------------------------------------------------------
diff --git a/doc/index.md b/doc/index.md
index b8d9c2f..11637b1 100644
--- a/doc/index.md
+++ b/doc/index.md
@@ -32,7 +32,7 @@ on the subject. For an overview of other storage options, refer to Cordova's
 
 - Amazon Fire OS
 - Android
-- BlackBerry 10*
+- BlackBerry 10
 - iOS
 - Windows Phone 7 and 8*
 - Windows 8*
@@ -111,17 +111,6 @@ unable to access their previously-stored files, depending on their device.
 If your application is new, or has never previously stored files in the
 persistent filesystem, then the "internal" setting is generally recommended.
 
-## BlackBerry Quirks
-
-`DirectoryEntry.removeRecursively()` may fail with a `ControlledAccessException` in the following cases:
-
-- An app attempts to access a directory created by a previous installation of the app.
-
-> Solution: ensure temporary directories are cleaned manually, or by the application prior to reinstallation.
-
-- If the device is connected by USB.
-
-> Solution: disconnect the USB cable from the device and run again.
 
 ## iOS Quirks
 - `FileReader.readAsText(blob, encoding)`

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/bff46b6f/plugin.xml
----------------------------------------------------------------------
diff --git a/plugin.xml b/plugin.xml
index 3bced58..731c51b 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -251,41 +251,45 @@ xmlns:android="http://schemas.android.com/apk/res/android"
         <config-file target="www/config.xml" parent="/widget">
             <feature name="File" value="File" />
         </config-file>
-        <js-module src="www/blackberry10/fileUtils.js" name="BB10Utils" />
-        <js-module src="www/blackberry10/DirectoryEntry.js" name="BB10DirectoryEntry">
-            <clobbers target="window.DirectoryEntry" />
+        <js-module src="www/blackberry10/FileProxy.js" name="FileProxy" >
+            <runs />
         </js-module>
-        <js-module src="www/blackberry10/DirectoryReader.js" name="BB10DirectoryReader">
-            <clobbers target="window.DirectoryReader" />
+        <js-module src="www/blackberry10/info.js" name="bb10FileSystemInfo">
+            <runs />
         </js-module>
-        <js-module src="www/blackberry10/Entry.js" name="BB10Entry">
-            <clobbers target="window.Entry" />
+        <js-module src="www/blackberry10/createEntryFromNative.js" name="bb10CreateEntryFromNative">
+            <runs />
         </js-module>
-        <js-module src="www/blackberry10/File.js" name="BB10File">
-            <clobbers target="window.File" />
+        <js-module src="www/blackberry10/requestAnimationFrame.js" name="bb10RequestAnimationFrame">
+            <runs />
         </js-module>
-        <js-module src="www/blackberry10/FileEntry.js" name="BB10FileEntry">
-            <clobbers target="window.FileEntry" />
-        </js-module>
-        <js-module src="www/blackberry10/FileReader.js" name="BB10FileReader">
-            <clobbers target="window.FileReader" />
-        </js-module>
-        <js-module src="www/blackberry10/FileSystem.js" name="BB10FileSystem">
-            <clobbers target="window.FileSystem" />
-        </js-module>
-        <js-module src="www/blackberry10/FileWriter.js" name="BB10FileWriter">
-            <clobbers target="window.FileWriter" />
-        </js-module>
-        <js-module src="www/blackberry10/requestFileSystem.js" name="BB10requestFileSystem">
-            <clobbers target="window.requestFileSystem" />
-        </js-module>
-        <js-module src="www/blackberry10/resolveLocalFileSystemURI.js" name="BB10resolveLocalFileSystemURI">
-            <clobbers target="window.resolveLocalFileSystemURI" />
+        <js-module src="www/blackberry10/FileSystem.js" name="bb10FileSystem">
+            <merges target="window.FileSystem" />
         </js-module>
-        <js-module src="www/blackberry10/resolveLocalFileSystemURL.js" name="BB10resolveLocalFileSystemURL">
-            <clobbers target="window.resolveLocalFileSystemURL" />
+        <js-module src="www/fileSystems-roots.js" name="fileSystems-roots">
+            <runs/>
         </js-module>
-        <source-file src="src/blackberry10/index.js"></source-file>
+        <js-module src="www/blackberry10/copyTo.js" name="copyToProxy" />
+        <js-module src="www/blackberry10/getDirectory.js" name="getDirectoryProxy" />
+        <js-module src="www/blackberry10/getFile.js" name="getFileProxy" />
+        <js-module src="www/blackberry10/getFileMetadata.js" name="getFileMetadataProxy" />
+        <js-module src="www/blackberry10/getMetadata.js" name="getMetadataProxy" />
+        <js-module src="www/blackberry10/getParent.js" name="getParentProxy" />
+        <js-module src="www/blackberry10/moveTo.js" name="moveToProxy" />
+        <js-module src="www/blackberry10/readAsArrayBuffer.js" name="readAsArrayBufferProxy" />
+        <js-module src="www/blackberry10/readAsBinaryString.js" name="readAsBinaryStringProxy" />
+        <js-module src="www/blackberry10/readAsDataURL.js" name="readAsDataURLProxy" />
+        <js-module src="www/blackberry10/readAsText.js" name="readAsTextProxy" />
+        <js-module src="www/blackberry10/readEntries.js" name="readEntriesProxy" />
+        <js-module src="www/blackberry10/remove.js" name="removeProxy" />
+        <js-module src="www/blackberry10/removeRecursively.js" name="removeRecursivelyProxy" />
+        <js-module src="www/blackberry10/resolveLocalFileSystemURI.js" name="resolveLocalFileSystemURIProxy" />
+        <js-module src="www/blackberry10/requestAllFileSystems.js" name="requestAllFileSystemsProxy" />
+        <js-module src="www/blackberry10/requestFileSystem.js" name="requestFileSystemProxy" />
+        <js-module src="www/blackberry10/setMetadata.js" name="setMetadataProxy" />
+        <js-module src="www/blackberry10/truncate.js" name="truncateProxy" />
+        <js-module src="www/blackberry10/write.js" name="writeProxy" />
+        <source-file src="src/blackberry10/index.js" />
     </platform>
 
     <!-- windows8 -->

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/bff46b6f/src/blackberry10/index.js
----------------------------------------------------------------------
diff --git a/src/blackberry10/index.js b/src/blackberry10/index.js
index 1e480b5..e8b597c 100644
--- a/src/blackberry10/index.js
+++ b/src/blackberry10/index.js
@@ -24,14 +24,8 @@ module.exports = {
         new PluginResult(args, env).ok();
     },
 
-    isSandboxed : function (success, fail, args, env) {
-        new PluginResult(args, env).ok(require("lib/webview").getSandbox() === "1");
-    },
-
-    resolveLocalPath : function (success, fail, args, env) {
-        var homeDir = window.qnx.webplatform.getApplication().getEnv("HOME").replace("/data", "/app/native/"),
-            path = homeDir + JSON.parse(decodeURIComponent(args[0])).substring(9);
-        require("lib/webview").setSandbox(false);
-        new PluginResult(args, env).ok(path);
+    getHomePath: function (success, fail, args, env) {
+        var homeDir = window.qnx.webplatform.getApplication().getEnv("HOME");
+        new PluginResult(args, env).ok(homeDir);
     }
 };

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/bff46b6f/www/blackberry10/DirectoryEntry.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/DirectoryEntry.js b/www/blackberry10/DirectoryEntry.js
deleted file mode 100644
index 64ded02..0000000
--- a/www/blackberry10/DirectoryEntry.js
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var argscheck = require('cordova/argscheck'),
-    utils = require('cordova/utils'),
-    Entry = require('./BB10Entry'),
-    FileError = require('./FileError'),
-    DirectoryReader = require('./BB10DirectoryReader'),
-    fileUtils = require('./BB10Utils'),
-    DirectoryEntry = function (name, fullPath, fileSystem) {
-        DirectoryEntry.__super__.constructor.call(this, false, true, name, fullPath, fileSystem);
-    };
-
-if (!window.requestAnimationFrame) {
-    window.requestAnimationFrame = function (callback) { callback(); };
-}
-
-utils.extend(DirectoryEntry, Entry);
-
-DirectoryEntry.prototype.createReader = function () {
-    return new DirectoryReader(this.fullPath);
-};
-
-DirectoryEntry.prototype.getDirectory = function (path, options, successCallback, errorCallback) {
-    var currentPath = this.nativeEntry.fullPath,
-        that = this,
-        fullPath;
-
-    if (path.indexOf("/") === 0) {
-        fullPath = path;
-    } else {
-        fullPath = currentPath + "/" + path;
-    }
-
-    argscheck.checkArgs('sOFF', 'DirectoryEntry.getDirectory', arguments);
-
-    if (fileUtils.isOutsideSandbox(fullPath)) {
-        cordova.exec(function () {
-            window.requestAnimationFrame(function () {
-                window.webkitRequestFileSystem(window.PERSISTENT, that.filesystem._size, function (fs) {
-                    fs.root.getDirectory(fullPath, options, function (entry) {
-                        successCallback(fileUtils.createEntry(entry));
-                    }, errorCallback);
-                }, errorCallback);
-            });
-        }, errorCallback, "org.apache.cordova.file", "setSandbox", [false]);
-    } else {
-        cordova.exec(function () {
-            window.requestAnimationFrame(function () {
-                window.webkitRequestFileSystem(fileUtils.getFileSystemName(that.filesystem) === "persistent" ? window.PERSISTENT : window.TEMPORARY, that.filesystem._size, function (fs) {
-                    fs.root.getDirectory(fullPath, options, function (entry) {
-                        successCallback(fileUtils.createEntry(entry));
-                    }, errorCallback);
-                }, errorCallback);
-            });
-        }, errorCallback, "org.apache.cordova.file", "setSandbox", [true]);
-    }
-};
-
-DirectoryEntry.prototype.removeRecursively = function (successCallback, errorCallback) {
-    argscheck.checkArgs('FF', 'DirectoryEntry.removeRecursively', arguments);
-    this.nativeEntry.removeRecursively(successCallback, errorCallback);
-};
-
-DirectoryEntry.prototype.getFile = function (path, options, successCallback, errorCallback) {
-    var currentPath = this.nativeEntry.fullPath,
-        that = this,
-        fullPath;
-
-    if (path.indexOf("/") === 0) {
-        fullPath = path;
-    } else {
-        fullPath = currentPath + "/" + path;
-    }
-
-    argscheck.checkArgs('sOFF', 'DirectoryEntry.getFile', arguments);
-
-    if (fileUtils.isOutsideSandbox(fullPath)) {
-        cordova.exec(function () {
-            window.requestAnimationFrame(function () {
-                window.webkitRequestFileSystem(window.PERSISTENT, that.filesystem._size, function (fs) {
-                    fs.root.getFile(fullPath, options, function (entry) {
-                        successCallback(fileUtils.createEntry(entry));
-                    }, errorCallback);
-                }, errorCallback);
-            });
-        }, errorCallback, "org.apache.cordova.file", "setSandbox", [false]);
-    } else {
-        cordova.exec(function () {
-            window.requestAnimationFrame(function () {
-                window.webkitRequestFileSystem(fileUtils.getFileSystemName(that.filesystem) === "persistent" ? window.PERSISTENT: window.TEMPORARY, that.filesystem._size, function (fs) {
-                    fs.root.getFile(fullPath, options, function (entry) {
-                        successCallback(fileUtils.createEntry(entry));
-                    }, errorCallback);
-                }, errorCallback);
-            });
-        }, errorCallback, "org.apache.cordova.file", "setSandbox", [true]);
-    }
-};
-
-module.exports = DirectoryEntry;

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/bff46b6f/www/blackberry10/DirectoryReader.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/DirectoryReader.js b/www/blackberry10/DirectoryReader.js
deleted file mode 100644
index 6aa3d73..0000000
--- a/www/blackberry10/DirectoryReader.js
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var FileError = require('./FileError'),
-    fileUtils = require('./BB10Utils');
-
-function DirectoryReader(path) {
-    this.path = path;
-    this.nativeReader = null;
-}
-
-DirectoryReader.prototype.readEntries = function(successCallback, errorCallback) {
-    var self = this,
-        win = typeof successCallback !== 'function' ? null : function(result) {
-            var retVal = [];
-            for (var i=0; i<result.length; i++) {
-                retVal.push(fileUtils.createEntry(result[i]));
-            }
-            successCallback(retVal);
-        },
-        fail = typeof errorCallback !== 'function' ? null : function(code) {
-            errorCallback(new FileError(code));
-        };
-    if (this.nativeReader) {
-        this.nativeReader.readEntries(win, fail);
-    } else {
-        resolveLocalFileSystemURI("filesystem:local:///persistent/" + this.path, function (entry) {
-            self.nativeReader = entry.nativeEntry.createReader()
-            self.nativeReader.readEntries(win, fail);
-        }, function () {
-            fail(FileError.NOT_FOUND_ERR);
-        });
-    }
-};
-
-module.exports = DirectoryReader;

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/bff46b6f/www/blackberry10/Entry.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/Entry.js b/www/blackberry10/Entry.js
deleted file mode 100644
index 7554e06..0000000
--- a/www/blackberry10/Entry.js
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var argscheck = require('cordova/argscheck'),
-    FileError = require('./FileError'),
-    Metadata = require('./Metadata'),
-    fileUtils = require('./BB10Utils');
-
-function Entry(isFile, isDirectory, name, fullPath, fileSystem) {
-    var strippedPath;
-    if (fullPath && fullPath.charAt(fullPath.length - 1) === '/') {
-        strippedPath = fullPath.slice(0, -1);
-    }
-    this.isFile = !!isFile;
-    this.isDirectory = !!isDirectory;
-    this.name = name || '';
-    this.fullPath = typeof strippedPath !== "undefined" ? strippedPath : (fullPath || '');
-    this.filesystem = fileSystem || null;
-}
-
-Entry.prototype.getMetadata = function(successCallback, errorCallback) {
-    argscheck.checkArgs('FF', 'Entry.getMetadata', arguments);
-    var success = function(lastModified) {
-        var metadata = new Metadata(lastModified);
-        if (typeof successCallback === 'function') {
-            successCallback(metadata);
-        }
-    };
-    this.nativeEntry.getMetadata(success, errorCallback);
-};
-
-Entry.prototype.setMetadata = function(successCallback, errorCallback, metadataObject) {
-    argscheck.checkArgs('FFO', 'Entry.setMetadata', arguments);
-    errorCallback("Not supported by platform");
-};
-
-Entry.prototype.moveTo = function(parent, newName, successCallback, errorCallback) {
-    argscheck.checkArgs('oSFF', 'Entry.moveTo', arguments);
-    var srcPath = this.fullPath,
-        name = newName || this.name,
-        success = function(entry) {
-            if (entry) {
-                if (typeof successCallback === 'function') {
-                    successCallback(fileUtils.createEntry(entry));
-                }
-            }
-            else {
-                if (typeof errorCallback === 'function') {
-                    errorCallback(new FileError(FileError.NOT_FOUND_ERR));
-                }
-            }
-        };
-    this.nativeEntry.moveTo(parent.nativeEntry, newName, success, errorCallback);
-};
-
-
-Entry.prototype.copyTo = function(parent, newName, successCallback, errorCallback) {
-    argscheck.checkArgs('oSFF', 'Entry.copyTo', arguments);
-    var srcPath = this.fullPath,
-        name = newName || this.name,
-        success = function(entry) {
-            if (entry) {
-                if (typeof successCallback === 'function') {
-                    successCallback(fileUtils.createEntry(entry));
-                }
-            }
-            else {
-                if (typeof errorCallback === 'function') {
-                    errorCallback(new FileError(FileError.NOT_FOUND_ERR));
-                }
-            }
-        };
-    this.nativeEntry.copyTo(parent.nativeEntry, newName, success, errorCallback);
-};
-
-Entry.prototype.toURL = function() {
-    return "file://" + this.nativeEntry.fullPath; 
-};
-
-Entry.prototype.toURI = function(mimeType) {
-    console.log("DEPRECATED: Update your code to use 'toURL'");
-    return this.toURL();
-};
-
-Entry.prototype.remove = function(successCallback, errorCallback) {
-    argscheck.checkArgs('FF', 'Entry.remove', arguments);
-    this.nativeEntry.remove(successCallback, errorCallback);
-};
-
-Entry.prototype.getParent = function(successCallback, errorCallback) {
-    argscheck.checkArgs('FF', 'Entry.getParent', arguments);
-    var win = successCallback && function(result) {
-        successCallback(fileUtils.createEntry(result));
-    };
-    this.nativeEntry.getParent(win, errorCallback);
-};
-
-module.exports = Entry;

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/bff46b6f/www/blackberry10/File.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/File.js b/www/blackberry10/File.js
deleted file mode 100644
index 7ba9734..0000000
--- a/www/blackberry10/File.js
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var fileUtils = require('./BB10Utils');
-
-/**
- * Constructor.
- * name {DOMString} name of the file, without path information
- * fullPath {DOMString} the full path of the file, including the name
- * type {DOMString} mime type
- * lastModifiedDate {Date} last modified date
- * size {Number} size of the file in bytes
- */
-
-var File = function(name, fullPath, type, lastModifiedDate, size){
-    this.name = name || '';
-    this.fullPath = fullPath || null;
-    this.type = type || null;
-    this.lastModifiedDate = lastModifiedDate || null;
-    this.size = size || 0;
-
-    // These store the absolute start and end for slicing the file.
-    this.start = 0;
-    this.end = this.size;
-};
-
-/**
- * Returns a "slice" of the file.
- * Slices of slices are supported.
- * start {Number} The index at which to start the slice (inclusive).
- * end {Number} The index at which to end the slice (exclusive).
- */
-File.prototype.slice = function(start, end) {
-    return fileUtils.createFile(this.nativeFile.slice(start, end));
-};
-
-
-module.exports = File;

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/bff46b6f/www/blackberry10/FileEntry.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/FileEntry.js b/www/blackberry10/FileEntry.js
deleted file mode 100644
index b358d71..0000000
--- a/www/blackberry10/FileEntry.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var utils = require('cordova/utils'),
-    Entry = require('./BB10Entry'),
-    FileWriter = require('./BB10FileWriter'),
-    File = require('./BB10File'),
-    fileUtils = require('./BB10Utils'),
-    FileError = require('./FileError'),
-    FileEntry = function (name, fullPath, fileSystem) {
-        FileEntry.__super__.constructor.apply(this, [true, false, name, fullPath, fileSystem]);
-    };
-
-utils.extend(FileEntry, Entry);
-
-FileEntry.prototype.createWriter = function(successCallback, errorCallback) {
-    this.file(function (file) {
-        successCallback(new FileWriter(file));
-    }, errorCallback);
-};
-
-FileEntry.prototype.file = function(successCallback, errorCallback) {
-    var fullPath = this.fullPath,
-        success = function (file) {
-            file.fullPath = fullPath;
-            successCallback(fileUtils.createFile(file));
-        };
-    this.nativeEntry.file(success, errorCallback);
-};
-
-module.exports = FileEntry;

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/bff46b6f/www/blackberry10/FileProxy.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/FileProxy.js b/www/blackberry10/FileProxy.js
new file mode 100644
index 0000000..b9aea3b
--- /dev/null
+++ b/www/blackberry10/FileProxy.js
@@ -0,0 +1,51 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+/*
+ * FileProxy
+ *
+ * Register all File exec calls to be handled by proxy
+ */
+
+module.exports = {
+    copyTo: require('org.apache.cordova.file.copyToProxy'),
+    getDirectory: require('org.apache.cordova.file.getDirectoryProxy'),
+    getFile: require('org.apache.cordova.file.getFileProxy'),
+    getFileMetadata: require('org.apache.cordova.file.getFileMetadataProxy'),
+    getMetadata: require('org.apache.cordova.file.getMetadataProxy'),
+    getParent: require('org.apache.cordova.file.getParentProxy'),
+    moveTo: require('org.apache.cordova.file.moveToProxy'),
+    readAsArrayBuffer: require('org.apache.cordova.file.readAsArrayBufferProxy'),
+    readAsBinaryString: require('org.apache.cordova.file.readAsBinaryStringProxy'),
+    readAsDataURL: require('org.apache.cordova.file.readAsDataURLProxy'),
+    readAsText: require('org.apache.cordova.file.readAsTextProxy'),
+    readEntries: require('org.apache.cordova.file.readEntriesProxy'),
+    remove: require('org.apache.cordova.file.removeProxy'),
+    removeRecursively: require('org.apache.cordova.file.removeRecursivelyProxy'),
+    resolveLocalFileSystemURI: require('org.apache.cordova.file.resolveLocalFileSystemURIProxy'),
+    requestAllFileSystems: require('org.apache.cordova.file.requestAllFileSystemsProxy'),
+    requestFileSystem: require('org.apache.cordova.file.requestFileSystemProxy'),
+    setMetadata: require('org.apache.cordova.file.setMetadataProxy'),
+    truncate: require('org.apache.cordova.file.truncateProxy'),
+    write: require('org.apache.cordova.file.writeProxy')
+};
+
+require('cordova/exec/proxy').add('File', module.exports);

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/bff46b6f/www/blackberry10/FileReader.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/FileReader.js b/www/blackberry10/FileReader.js
deleted file mode 100644
index a3943ba..0000000
--- a/www/blackberry10/FileReader.js
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var origFileReader = window.FileReader,
-    fileUtils = require('./BB10Utils'),
-    utils = require('cordova/utils');
-
-var FileReader = function() {
-    this.nativeReader = new origFileReader();
-};
-
-utils.defineGetter(FileReader.prototype, 'readyState', function() {
-    return this.nativeReader.readyState;
-});
-
-utils.defineGetter(FileReader.prototype, 'error', function() {
-    return this.nativeReader.error;
-});
-
-utils.defineGetter(FileReader.prototype, 'result', function() {
-    return this.nativeReader.result;
-});
-
-function defineEvent(eventName) {
-    utils.defineGetterSetter(FileReader.prototype, eventName, function() {
-        return this.nativeReader[eventName] || null;
-    }, function(value) {
-        this.nativeReader[eventName] = value;
-    });
-}
-
-defineEvent('onabort');
-defineEvent('onerror');
-defineEvent('onload');
-defineEvent('onloadend');
-defineEvent('onloadstart');
-defineEvent('onprogress');
-
-FileReader.prototype.abort = function() {
-    return this.nativeReader.abort();
-};
-
-function read(method, context, file, encoding) {
-    if (file.fullPath) {
-         resolveLocalFileSystemURI(file.fullPath, function (entry) {
-            entry.nativeEntry.file(function (nativeFile) {
-                context.nativeReader[method].call(context.nativeReader, nativeFile, encoding);
-            }, context.onerror);
-        }, context.onerror);
-    } else {
-        context.nativeReader[method](file, encoding);
-    }
-}
-
-FileReader.prototype.readAsText = function(file, encoding) {
-    read("readAsText", this, file, encoding);
-};
-
-FileReader.prototype.readAsDataURL = function(file) {
-    read("readAsDataURL", this, file);
-};
-
-FileReader.prototype.readAsBinaryString = function(file) {
-    read("readAsBinaryString", this, file);
-};
-
-FileReader.prototype.readAsArrayBuffer = function(file) {
-    read("readAsArrayBuffer", this, file);
-};
-
-window.FileReader = FileReader;
-module.exports = FileReader;

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/bff46b6f/www/blackberry10/FileSystem.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/FileSystem.js b/www/blackberry10/FileSystem.js
index d1432d6..cc0a7f6 100644
--- a/www/blackberry10/FileSystem.js
+++ b/www/blackberry10/FileSystem.js
@@ -19,9 +19,28 @@
  *
 */
 
-module.exports = function(name, root) {
-    this.name = name || null;
-    if (root) {
-        this.root = root;
+/*
+ * FileSystem
+ * 
+ * Translate temporary / persistent / root file paths
+ */
+
+var info = require("org.apache.cordova.file.bb10FileSystemInfo");
+
+module.exports = {
+    __format__: function(fullPath) {
+        switch (this.name) {
+            case 'temporary':
+                path = info.temporaryPath + fullPath;
+                break;
+            case 'persistent':
+                path = info.persistentPath + fullPath;
+                break;
+            case 'root':
+                path = 'file://' + fullPath;
+                break;
+        }
+        return window.encodeURI(path);
     }
 };
+

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/bff46b6f/www/blackberry10/FileWriter.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/FileWriter.js b/www/blackberry10/FileWriter.js
deleted file mode 100644
index d50efc5..0000000
--- a/www/blackberry10/FileWriter.js
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var FileError = require('./FileError'),
-    ProgressEvent = require('./ProgressEvent'),
-    fileUtils = require('./BB10Utils'),
-    utils = require('cordova/utils');
-
-function FileWriter (file) {
-    var that = this;
-    this.file = file;
-    this.events = {};
-    this.pending = [];
-    resolveLocalFileSystemURI(file.fullPath, function (entry) {
-        entry.nativeEntry.createWriter(function (writer) {
-            var i,
-                event;
-            that.nativeWriter = writer;
-            for (event in that.events) {
-                if (that.events.hasOwnProperty(event)) {
-                    that.nativeWriter[event] = that.events[event];
-                }
-            }
-            for (i = 0; i < that.pending.length; i++) {
-                that.pending[i]();
-            }
-        });
-    });
-    this.events = {};
-    this.pending = [];
-}
-
-utils.defineGetter(FileWriter.prototype, 'error', function() {
-    return this.nativeWriter ? this.nativeWriter.error : null;
-});
-
-utils.defineGetter(FileWriter.prototype, 'fileName', function() {
-    return this.nativeWriter ? this.nativeWriter.fileName : this.file.name;
-});
-
-utils.defineGetter(FileWriter.prototype, 'length', function() {
-    return this.nativeWriter ? this.nativeWriter.length : this.file.size;
-});
-
-utils.defineGetter(FileWriter.prototype, 'position', function() {
-    return this.nativeWriter ? this.nativeWriter.position : 0;
-});
-
-utils.defineGetter(FileWriter.prototype, 'readyState', function() {
-    return this.nativeWriter ? this.nativeWriter.readyState : 0;
-});
-
-function defineEvent(eventName) {
-    utils.defineGetterSetter(FileWriter.prototype, eventName, function() {
-        return this.nativeWriter ? this.nativeWriter[eventName] || null : this.events[eventName] || null;
-    }, function(value) {
-        if (this.nativeWriter) {
-            this.nativeWriter[eventName] = value;
-        }
-        else {
-            this.events[eventName] = value;
-        }
-    });
-}
-
-defineEvent('onabort');
-defineEvent('onerror');
-defineEvent('onprogress');
-defineEvent('onwrite');
-defineEvent('onwriteend');
-defineEvent('onwritestart');
-
-FileWriter.prototype.abort = function() {
-    this.nativeWriter.abort();
-};
-
-FileWriter.prototype.write = function(text) {
-    var that = this,
-        op = function () {
-            that.nativeWriter.write(new Blob([text]));
-        };
-    this.nativeWriter ? op() : this.pending.push(op);
-
-};
-
-FileWriter.prototype.seek = function(offset) {
-    var that = this,
-        op = function () {
-            that.nativeWriter.seek(offset);
-        };
-    this.nativeWriter ? op() : this.pending.push(op);
-};
-
-FileWriter.prototype.truncate = function(size) {
-    var that = this,
-        op = function () {
-            that.nativeWriter.truncate(size);
-        };
-    this.nativeWriter ? op() : this.pending.push(op);
-};
-
-module.exports = FileWriter;

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/bff46b6f/www/blackberry10/copyTo.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/copyTo.js b/www/blackberry10/copyTo.js
new file mode 100644
index 0000000..ebbce41
--- /dev/null
+++ b/www/blackberry10/copyTo.js
@@ -0,0 +1,135 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+/* 
+ * copyTo
+ * 
+ * IN:
+ *  args
+ *   0 - URL of entry to copy
+ *   1 - URL of the directory into which to copy/move the entry
+ *   2 - the new name of the entry, defaults to the current name
+ *  move - if true, delete the entry which was copied
+ * OUT:
+ *  success - entry for the copied file or directory
+ *  fail - FileError
+ */
+
+var resolve = cordova.require('org.apache.cordova.file.resolveLocalFileSystemURIProxy'),
+    requestAnimationFrame = cordova.require('org.apache.cordova.file.bb10RequestAnimationFrame');
+
+module.exports = function (success, fail, args, move) {
+    var uri = args[0],
+        destination = args[1],
+        fileName = args[2],
+        copiedEntry,
+        onSuccess = function () {
+            if (typeof(success) === 'function') {
+                success(copiedEntry);
+            }
+        },
+        onFail = function (error) {
+            if (typeof(fail) === 'function') {
+                if (error && error.code) {
+                    //set error codes expected by mobile spec
+                    if (uri === destination) {
+                        fail(FileError.INVALID_MODIFICATION_ERR);
+                    } else if (error.code === FileError.SECURITY_ERR) {
+                        fail(FileError.INVALID_MODIFICATION_ERR);
+                    } else {
+                        fail(error.code);
+                    }
+                } else {
+                    fail(error);
+                }
+            }
+        },
+        writeFile = function (fileEntry, blob, entry) {
+            copiedEntry = fileEntry;
+            fileEntry.createWriter(function (fileWriter) {
+                fileWriter.onwriteend = function () {
+                    if (move) {
+                        entry.nativeEntry.remove(onSuccess, function () {
+                            console.error("Move operation failed. Files may exist at both source and destination");
+                        });
+                    } else {
+                        onSuccess();
+                    }
+                };
+                fileWriter.onerror = onFail;
+                fileWriter.write(blob);
+            }, onFail);
+        },
+        copyFile = function (entry) {
+            if (entry.nativeEntry.file) {
+                entry.nativeEntry.file(function (file) {
+                    var reader = new FileReader()._realReader;
+                    reader.onloadend = function (e) {
+                        var contents = new Uint8Array(this.result),
+                            blob = new Blob([contents]);
+                        resolve(function (destEntry) {
+                            requestAnimationFrame(function () {
+                                destEntry.nativeEntry.getFile(fileName, {create: true}, function (fileEntry) {
+                                    writeFile(fileEntry, blob, entry);
+                                }, onFail);
+                            });
+                        }, onFail, [destination]);   
+                    };
+                    reader.onerror = onFail;
+                    reader.readAsArrayBuffer(file);
+                }, onFail);
+            } else {
+                onFail(FileError.INVALID_MODIFICATION_ERR);
+            }
+        },
+        copyDirectory = function (entry) {
+            resolve(function (destEntry) {
+                if (entry.filesystemName !== destEntry.filesystemName) {
+                    console.error("Copying directories between filesystems is not supported on BB10");
+                    onFail(FileError.INVALID_MODIFICATION_ERR);   
+                } else {
+                    entry.nativeEntry.copyTo(destEntry.nativeEntry, fileName, function () {
+                        resolve(function (copiedDir) {
+                            copiedEntry = copiedDir;
+                            if (move) {
+                                entry.nativeEntry.removeRecursively(onSuccess, onFail);
+                            } else {
+                                onSuccess();
+                            }
+                        }, onFail, [destination + fileName]);
+                    }, onFail);
+                }
+            }, onFail, [destination]); 
+        };
+    if (destination + fileName === uri) {
+        onFail(FileError.INVALID_MODIFICATION_ERR);
+    } else if (fileName.indexOf(':') > -1) {
+        onFail(FileError.ENCODING_ERR);
+    } else {
+        resolve(function (entry) {
+            if (entry.isDirectory) {
+                copyDirectory(entry);
+            } else {
+                copyFile(entry);
+            }
+        }, onFail, [uri]);
+    }
+};

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/bff46b6f/www/blackberry10/createEntryFromNative.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/createEntryFromNative.js b/www/blackberry10/createEntryFromNative.js
new file mode 100644
index 0000000..1a340f3
--- /dev/null
+++ b/www/blackberry10/createEntryFromNative.js
@@ -0,0 +1,72 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+/*
+ * createEntryFromNative
+ * 
+ * IN
+ *  native - webkit Entry
+ * OUT
+ *  returns Cordova entry
+ */
+
+var info = require("org.apache.cordova.file.bb10FileSystemInfo");
+
+module.exports = function (native) {
+    var entry = {
+            nativeEntry: native,
+            isDirectory: !!native.isDirectory,
+            isFile: !!native.isFile,
+            name: native.name,
+            fullPath: native.fullPath,
+            filesystemName: native.filesystem.name,
+            nativeURL: native.toURL()
+        },
+        persistentPath = info.persistentPath.substring(7),
+        temporaryPath = info.temporaryPath.substring(7);
+    //fix bb10 webkit incorrect nativeURL
+    if (native.filesystem.name === 'root') {
+        entry.nativeURL = 'file:///' + native.fullPath;
+    } else if (entry.nativeURL.indexOf('filesystem:local:///persistent/') === 0) {
+        entry.nativeURL = info.persistentPath + native.fullPath;
+    } else if (entry.nativeURL.indexOf('filesystem:local:///temporary') === 0) {
+        entry.nativeURL = info.temporaryPath + native.fullPath;
+    }
+    //translate file system name from bb10 webkit
+    if (entry.filesystemName === 'local__0:Persistent' || entry.fullPath.indexOf(persistentPath) !== -1) {
+        entry.filesystemName = 'persistent';
+    } else if (entry.filesystemName === 'local__0:Temporary' || entry.fullPath.indexOf(temporaryPath) !== -1) {
+        entry.filesystemName = 'temporary';
+    }
+    //set root on fullPath for persistent / temporary locations
+    entry.fullPath = entry.fullPath.replace(persistentPath, "");
+    entry.fullPath = entry.fullPath.replace(temporaryPath, "");
+    //set trailing slash on directory
+    if (entry.isDirectory && entry.fullPath.substring(entry.fullPath.length - 1) !== '/') {
+        entry.fullPath += '/';
+    }
+    if (entry.isDirectory && entry.nativeURL.substring(entry.nativeURL.length - 1) !== '/') {
+        entry.nativeURL += '/';
+    }
+    //encode URL
+    entry.nativeURL = window.encodeURI(entry.nativeURL);
+    return entry;
+};

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/bff46b6f/www/blackberry10/fileUtils.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/fileUtils.js b/www/blackberry10/fileUtils.js
deleted file mode 100644
index 740669c..0000000
--- a/www/blackberry10/fileUtils.js
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-function convertPath(url) {
-    return decodeURI(url).substring(11).replace(/\/$/, '');
-}
-
-module.exports = {
-    createEntry: function (entry) {
-        var cordovaEntry;
-        if (entry.isFile) {
-            cordovaEntry = new window.FileEntry(entry.name, entry.fullPath, entry.filesystem);
-        } else {
-            cordovaEntry = new window.DirectoryEntry(entry.name, entry.fullPath, entry.filesystem);
-        }
-        cordovaEntry.nativeEntry = entry;
-        return cordovaEntry;
-    },
-
-    createFile: function (file) {
-        var cordovaFile = new File(file.name, file.fullPath, file.type, file.lastModifiedDate, file.size);
-        cordovaFile.nativeFile = file;
-        cordovaFile.fullPath = file.fullPath;
-        return cordovaFile;
-    },
-
-    getFileSystemName: function (fs) {
-        return ((fs.name.indexOf('Persistent') != -1) || (fs.name === "persistent")) ? 'persistent' : 'temporary';
-    },
-
-    isOutsideSandbox: function (path) {
-        return (path.indexOf("accounts/1000") !== -1);
-    }
-};

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/bff46b6f/www/blackberry10/getDirectory.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/getDirectory.js b/www/blackberry10/getDirectory.js
new file mode 100644
index 0000000..d032251
--- /dev/null
+++ b/www/blackberry10/getDirectory.js
@@ -0,0 +1,72 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+/* 
+ * getDirectory
+ * 
+ * IN:
+ *  args
+ *   0 - local filesytem URI for the base directory to search
+ *   1 - directory to be created/returned; may be absolute path or relative path
+ *   2 - options object
+ * OUT:
+ *  success - DirectoryEntry
+ *  fail - FileError code
+ */
+
+var resolve = cordova.require('org.apache.cordova.file.resolveLocalFileSystemURIProxy'),
+    requestAnimationFrame = cordova.require('org.apache.cordova.file.bb10RequestAnimationFrame');
+
+module.exports = function (success, fail, args) {
+    var uri = args[0] === "/" ? "" : args[0],
+        dir = args[1],
+        options = args[2],
+        onSuccess = function (entry) {
+            if (typeof(success) === 'function') {
+                success(entry);
+            }
+        },
+        onFail = function (error) {
+            if (typeof(fail) === 'function') {
+                if (error && error.code) {
+                    //set error codes expected by mobile-spec tests
+                    if (error.code === FileError.INVALID_MODIFICATION_ERR  && options.exclusive) {
+                        fail(FileError.PATH_EXISTS_ERR);
+                    } else if ( error.code === FileError.NOT_FOUND_ERR && dir.indexOf(':') > 0) {
+                        fail(FileError.ENCODING_ERR);
+                    } else {
+                        fail(error.code);
+                    }
+                } else {
+                    fail(error);
+                }
+            }
+        };
+    resolve(function (entry) {
+        requestAnimationFrame(function () {
+            entry.nativeEntry.getDirectory(dir, options, function (nativeEntry) {
+                resolve(function (entry) {
+                    onSuccess(entry);
+                }, onFail, [uri + "/" + dir]);
+            }, onFail);
+        });
+    }, onFail, [uri]);
+};

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/bff46b6f/www/blackberry10/getFile.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/getFile.js b/www/blackberry10/getFile.js
new file mode 100644
index 0000000..0c7a1fe
--- /dev/null
+++ b/www/blackberry10/getFile.js
@@ -0,0 +1,57 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+/* 
+ * getFile
+ *
+ * IN:
+ *  args
+ *   0 - local filesytem URI for the base directory to search
+ *   1 - file to be created/returned; may be absolute path or relative path
+ *   2 - options object
+ * OUT:
+ *  success - FileEntry
+ *  fail - FileError code
+ */
+
+var resolve = cordova.require('org.apache.cordova.file.resolveLocalFileSystemURIProxy');
+
+module.exports = function (success, fail, args) {
+    var uri = args[0] === "/" ? "" : args[0] + "/" + args[1],
+        options = args[2],
+        onSuccess = function (entry) {
+            if (typeof(success) === 'function') {
+                success(entry);
+            }
+        },
+        onFail = function (code) {
+            if (typeof(fail) === 'function') {
+                fail(code);
+            }
+        };
+    resolve(function (entry) {
+        if (!entry.isFile) {
+            onFail(FileError.TYPE_MISMATCH_ERR);
+        } else {
+            onSuccess(entry);
+        }
+    }, onFail, [uri, options]);
+};

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/bff46b6f/www/blackberry10/getFileMetadata.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/getFileMetadata.js b/www/blackberry10/getFileMetadata.js
new file mode 100644
index 0000000..30b256c
--- /dev/null
+++ b/www/blackberry10/getFileMetadata.js
@@ -0,0 +1,61 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+/* 
+ * getFileMetadata
+ *
+ * IN:
+ *  args
+ *   0 - local filesytem URI
+ * OUT:
+ *  success - file
+ *   - name
+ *   - type
+ *   - lastModifiedDate
+ *   - size
+ *  fail - FileError code
+ */
+
+var resolve = cordova.require('org.apache.cordova.file.resolveLocalFileSystemURIProxy'),
+    requestAnimationFrame = cordova.require('org.apache.cordova.file.bb10RequestAnimationFrame');
+
+module.exports = function (success, fail, args) {
+    var uri = args[0],
+        onSuccess = function (entry) {
+            if (typeof(success) === 'function') {
+                success(entry);
+            }
+        },
+        onFail = function (error) {
+            if (typeof(fail) === 'function') {
+                if (error.code) {
+                    fail(error.code);
+                } else {
+                    fail(error);
+                }
+            }
+        };
+    resolve(function (entry) {
+        requestAnimationFrame(function () {
+            entry.nativeEntry.file(onSuccess, onFail);
+        });
+    }, onFail, [uri]);
+};

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/bff46b6f/www/blackberry10/getMetadata.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/getMetadata.js b/www/blackberry10/getMetadata.js
new file mode 100644
index 0000000..31abd5c
--- /dev/null
+++ b/www/blackberry10/getMetadata.js
@@ -0,0 +1,54 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+/* 
+ * getMetadata
+ *
+ * IN:
+ *  args
+ *   0 - local filesytem URI
+ * OUT:
+ *  success - metadata
+ *  fail - FileError code
+ */
+
+var resolve = cordova.require('org.apache.cordova.file.resolveLocalFileSystemURIProxy');
+
+module.exports = function (success, fail, args) {
+    var uri = args[0],
+        onSuccess = function (entry) {
+            if (typeof(success) === 'function') {
+                success(entry);
+            }
+        },
+        onFail = function (error) {
+            if (typeof(fail) === 'function') {
+                if (error.code) {
+                    fail(error.code);
+                } else {
+                    fail(error);
+                }
+            }
+        };
+    resolve(function (entry) {
+        entry.nativeEntry.getMetadata(onSuccess, onFail);
+    }, onFail, [uri]);
+};

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/bff46b6f/www/blackberry10/getParent.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/getParent.js b/www/blackberry10/getParent.js
new file mode 100644
index 0000000..f05eec0
--- /dev/null
+++ b/www/blackberry10/getParent.js
@@ -0,0 +1,57 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+/* 
+ * getParent
+ *
+ * IN:
+ *  args
+ *   0 - local filesytem URI
+ * OUT:
+ *  success - DirectoryEntry of parent
+ *  fail - FileError code
+ */
+
+var resolve = cordova.require('org.apache.cordova.file.resolveLocalFileSystemURIProxy'),
+    requestAnimationFrame = cordova.require('org.apache.cordova.file.bb10RequestAnimationFrame');
+
+module.exports = function (success, fail, args) {
+    var uri = args[0],
+        onSuccess = function (entry) {
+            if (typeof(success) === 'function') {
+                success(entry);
+            }
+        },
+        onFail = function (error) {
+            if (typeof(fail) === 'function') {
+                if (error && error.code) {
+                    fail(error.code);
+                } else {
+                    fail(error);
+                }
+            }
+        };
+    resolve(function (entry) {
+        requestAnimationFrame(function () {
+            entry.nativeEntry.getParent(onSuccess, onFail);
+        });
+    }, onFail, [uri]);
+};

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/bff46b6f/www/blackberry10/info.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/info.js b/www/blackberry10/info.js
new file mode 100644
index 0000000..716dba2
--- /dev/null
+++ b/www/blackberry10/info.js
@@ -0,0 +1,52 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+/* 
+ * info
+ *
+ * persistentPath - full path to app sandboxed persistent storage
+ * temporaryPath - full path to app sandboxed temporary storage
+ * localPath - full path to app source (www dir)
+ * MAX_SIZE - maximum size for filesystem request
+ */
+
+var info = {
+    persistentPath: "", 
+    temporaryPath: "", 
+    localPath: "",
+    MAX_SIZE: 64 * 1024 * 1024 * 1024
+};
+
+cordova.exec(
+    function (path) {
+        info.persistentPath = 'file://' + path + '/webviews/webfs/persistent/local__0';
+        info.temporaryPath = 'file://' + path + '/webviews/webfs/temporary/local__0';
+        info.localPath = path.replace('/data', '/app/native');
+    },
+    function () {
+        console.error('Unable to determine local storage file path');
+    },
+    'org.apache.cordova.file',
+    'getHomePath',
+    false
+);
+
+module.exports = info;

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/bff46b6f/www/blackberry10/moveTo.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/moveTo.js b/www/blackberry10/moveTo.js
new file mode 100644
index 0000000..7ca2ab3
--- /dev/null
+++ b/www/blackberry10/moveTo.js
@@ -0,0 +1,39 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+/* 
+ * moveTo
+ * 
+ * IN:
+ *  args
+ *   0 - URL of entry to move
+ *   1 - URL of the directory into which to move the entry
+ *   2 - the new name of the entry, defaults to the current name
+ * OUT:
+ *  success - entry for the copied file or directory
+ *  fail - FileError
+ */
+
+var copy = cordova.require('org.apache.cordova.file.copyToProxy');
+
+module.exports = function (success, fail, args) {
+    copy(success, fail, args, true);
+};

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/bff46b6f/www/blackberry10/readAsArrayBuffer.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/readAsArrayBuffer.js b/www/blackberry10/readAsArrayBuffer.js
new file mode 100644
index 0000000..5615fb7
--- /dev/null
+++ b/www/blackberry10/readAsArrayBuffer.js
@@ -0,0 +1,68 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+/* 
+ * readAsArrayBuffer
+ * 
+ * IN:
+ *  args
+ *   0 - URL of file to read
+ *   1 - start position
+ *   2 - end position
+ * OUT:
+ *  success - ArrayBuffer of file
+ *  fail - FileError
+ */
+
+var resolve = cordova.require('org.apache.cordova.file.resolveLocalFileSystemURIProxy'),
+    requestAnimationFrame = cordova.require('org.apache.cordova.file.bb10RequestAnimationFrame');
+
+module.exports = function (success, fail, args) {
+    var uri = args[0],
+        start = args[1],
+        end = args[2],
+        onSuccess = function (data) {
+            if (typeof success === 'function') {
+                success(data);
+            }
+        },
+        onFail = function (error) {
+            if (typeof fail === 'function') {
+                if (error && error.code) {
+                    fail(error.code);
+                } else {
+                    fail(error);
+                }
+            }
+        };
+    resolve(function (fs) {
+        requestAnimationFrame(function () {
+            fs.nativeEntry.file(function (file) {
+                var reader = new FileReader()._realReader;
+                reader.onloadend = function () {
+                    onSuccess(this.result.slice(start, end));
+                };
+                reader.onerror = onFail;
+                reader.readAsArrayBuffer(file); 
+            }, onFail);
+        });
+    }, fail, [uri]);
+};

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/bff46b6f/www/blackberry10/readAsBinaryString.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/readAsBinaryString.js b/www/blackberry10/readAsBinaryString.js
new file mode 100644
index 0000000..01ae922
--- /dev/null
+++ b/www/blackberry10/readAsBinaryString.js
@@ -0,0 +1,68 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+/* 
+ * readAsBinaryString
+ * 
+ * IN:
+ *  args
+ *   0 - URL of file to read
+ *   1 - start position
+ *   2 - end position
+ * OUT:
+ *  success - BinaryString contents of file
+ *  fail - FileError
+ */
+
+var resolve = cordova.require('org.apache.cordova.file.resolveLocalFileSystemURIProxy'),
+    requestAnimationFrame = cordova.require('org.apache.cordova.file.bb10RequestAnimationFrame');
+
+module.exports = function (success, fail, args) {
+    var uri = args[0],
+        start = args[1],
+        end = args[2],
+        onSuccess = function (data) {
+            if (typeof success === 'function') {
+                success(data);
+            }
+        },
+        onFail = function (error) {
+            if (typeof fail === 'function') {
+                if (error && error.code) {
+                    fail(error.code);
+                } else {
+                    fail(error);
+                }
+            }
+        };
+    resolve(function (fs) {
+        requestAnimationFrame(function () {
+            fs.nativeEntry.file(function (file) {
+                var reader = new FileReader()._realReader;
+                reader.onloadend = function () {
+                    onSuccess(this.result.substring(start, end));
+                };
+                reader.onerror = onFail;
+                reader.readAsBinaryString(file); 
+            }, onFail);
+        });
+    }, fail, [uri]);
+};

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/bff46b6f/www/blackberry10/readAsDataURL.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/readAsDataURL.js b/www/blackberry10/readAsDataURL.js
new file mode 100644
index 0000000..c19b23c
--- /dev/null
+++ b/www/blackberry10/readAsDataURL.js
@@ -0,0 +1,65 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+/* 
+ * readAsDataURL
+ * 
+ * IN:
+ *  args
+ *   0 - URL of file to read
+ * OUT:
+ *  success - DataURL representation of file contents
+ *  fail - FileError
+ */
+
+
+var resolve = cordova.require('org.apache.cordova.file.resolveLocalFileSystemURIProxy'),
+    requestAnimationFrame = cordova.require('org.apache.cordova.file.bb10RequestAnimationFrame');
+
+module.exports = function (success, fail, args) {
+    var uri = args[0],
+        onSuccess = function (data) {
+            if (typeof success === 'function') {
+                success(data);
+            }
+        },
+        onFail = function (error) {
+            if (typeof fail === 'function') {
+                if (error && error.code) {
+                    fail(error.code);
+                } else {
+                    fail(error);
+                }
+            }
+        };
+    resolve(function (fs) {
+        requestAnimationFrame(function () {
+            fs.nativeEntry.file(function (file) {
+                var reader = new FileReader()._realReader;
+                reader.onloadend = function () {
+                    onSuccess(this.result);
+                };
+                reader.onerror = onFail;
+                reader.readAsDataURL(file); 
+            }, onFail);
+        });
+    }, fail, [uri]);
+};

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/bff46b6f/www/blackberry10/readAsText.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/readAsText.js b/www/blackberry10/readAsText.js
new file mode 100644
index 0000000..6a85eb8
--- /dev/null
+++ b/www/blackberry10/readAsText.js
@@ -0,0 +1,77 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+/* 
+ * readAsText
+ * 
+ * IN:
+ *  args
+ *   0 - URL of file to read
+ *   1 - encoding
+ *   2 - start position
+ *   3 - end position
+ * OUT:
+ *  success - text contents of file
+ *  fail - FileError
+ */
+
+
+var resolve = cordova.require('org.apache.cordova.file.resolveLocalFileSystemURIProxy'),
+    requestAnimationFrame = cordova.require('org.apache.cordova.file.bb10RequestAnimationFrame');
+
+module.exports = function (success, fail, args) {
+    var uri = args[0],
+        start = args[2],
+        end = args[3],
+        onSuccess = function (data) {
+            if (typeof success === 'function') {
+                success(data);
+            }
+        },
+        onFail = function (error) {
+            if (typeof fail === 'function') {
+                if (error && error.code) {
+                    fail(error.code);
+                } else {
+                    fail(error);
+                }
+            }
+        };
+    resolve(function (fs) {
+        requestAnimationFrame(function () {
+            fs.nativeEntry.file(function (file) {
+                var reader = new FileReader()._realReader;
+                reader.onloadend = function () {
+                    var contents = new Uint8Array(this.result).subarray(start, end),
+                        blob = new Blob([contents]),
+                        textReader = new FileReader()._realReader;
+                    textReader.onloadend = function () {
+                        onSuccess(this.result);
+                    };
+                    textReader.onerror = onFail;
+                    textReader.readAsText(blob);
+                };
+                reader.onerror = onFail;
+                reader.readAsArrayBuffer(file);
+            }, onFail);
+        });
+    }, fail, [uri]);
+};

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/bff46b6f/www/blackberry10/readEntries.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/readEntries.js b/www/blackberry10/readEntries.js
new file mode 100644
index 0000000..aea2ec0
--- /dev/null
+++ b/www/blackberry10/readEntries.js
@@ -0,0 +1,71 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+/* 
+ * readEntries
+ * 
+ * IN:
+ *  args
+ *   0 - URL of directory to list
+ * OUT:
+ *  success - Array of Entry objects
+ *  fail - FileError
+ */
+
+var resolve = cordova.require('org.apache.cordova.file.resolveLocalFileSystemURIProxy'),
+    info = require('org.apache.cordova.file.bb10FileSystemInfo'),
+    requestAnimationFrame = cordova.require('org.apache.cordova.file.bb10RequestAnimationFrame'),
+    createEntryFromNative = cordova.require('org.apache.cordova.file.bb10CreateEntryFromNative');
+
+module.exports = function (success, fail, args) {
+    var uri = args[0],
+        onSuccess = function (data) {
+            if (typeof success === 'function') {
+                success(data);
+            }
+        },
+        onFail = function (error) {
+            if (typeof fail === 'function') {
+                if (error.code) {
+                    fail(error.code);
+                } else {
+                    fail(error);
+                }
+            }
+        };
+    resolve(function (fs) {
+        requestAnimationFrame(function () {
+            var reader = fs.nativeEntry.createReader(),
+                entries = [],
+                readEntries = function() {
+                    reader.readEntries(function (results) {
+                        if (!results.length) {
+                            onSuccess(entries.sort().map(createEntryFromNative));
+                        } else {
+                            entries = entries.concat(Array.prototype.slice.call(results || [], 0));
+                            readEntries();
+                        }
+                    }, onFail);
+                };
+            readEntries();
+        });
+    }, fail, [uri]);
+};

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/bff46b6f/www/blackberry10/remove.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/remove.js b/www/blackberry10/remove.js
new file mode 100644
index 0000000..14054ad
--- /dev/null
+++ b/www/blackberry10/remove.js
@@ -0,0 +1,61 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+/* 
+ * remove
+ * 
+ * IN:
+ *  args
+ *   0 - URL of Entry to remove
+ * OUT:
+ *  success - (no args)
+ *  fail - FileError
+ */
+
+var resolve = cordova.require('org.apache.cordova.file.resolveLocalFileSystemURIProxy'),
+    requestAnimationFrame = cordova.require('org.apache.cordova.file.bb10RequestAnimationFrame');
+
+module.exports = function (success, fail, args) {
+    var uri = args[0],
+        onSuccess = function (data) {
+            if (typeof success === 'function') {
+                success(data);
+            }
+        },
+        onFail = function (error) {
+            if (typeof fail === 'function') {
+                if (error && error.code) {
+                    fail(error.code);
+                } else {
+                    fail(error);
+                }
+            }
+        };
+    resolve(function (fs) {
+        requestAnimationFrame(function () {
+            if (fs.fullPath === '/') {
+                onFail(FileError.NO_MODIFICATION_ALLOWED_ERR);
+            } else {
+                fs.nativeEntry.remove(onSuccess, onFail);
+            }
+        });
+    }, fail, [uri]);
+};

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/bff46b6f/www/blackberry10/removeRecursively.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/removeRecursively.js b/www/blackberry10/removeRecursively.js
new file mode 100644
index 0000000..20c1912
--- /dev/null
+++ b/www/blackberry10/removeRecursively.js
@@ -0,0 +1,62 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+/* 
+ * removeRecursively
+ * 
+ * IN:
+ *  args
+ *   0 - URL of DirectoryEntry to remove recursively
+ * OUT:
+ *  success - (no args)
+ *  fail - FileError
+ */
+
+var resolve = cordova.require('org.apache.cordova.file.resolveLocalFileSystemURIProxy'),
+    requestAnimationFrame = cordova.require('org.apache.cordova.file.bb10RequestAnimationFrame');
+
+module.exports = function (success, fail, args) {
+    var uri = args[0],
+        onSuccess = function (data) {
+            if (typeof success === 'function') {
+                success(data);
+            }
+        },
+        onFail = function (error) {
+            if (typeof fail === 'function') {
+                if (error.code) {
+                    if (error.code === FileError.INVALID_MODIFICATION_ERR) {
+                        //mobile-spec expects this error code
+                        fail(FileError.NO_MODIFICATION_ALLOWED_ERR);
+                    } else {
+                        fail(error.code);
+                    }
+                } else {
+                    fail(error);
+                }
+            }
+        };
+    resolve(function (fs) {
+        requestAnimationFrame(function () {
+            fs.nativeEntry.removeRecursively(onSuccess, onFail);
+        }); 
+    }, fail, [uri]);
+};

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/bff46b6f/www/blackberry10/requestAllFileSystems.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/requestAllFileSystems.js b/www/blackberry10/requestAllFileSystems.js
new file mode 100644
index 0000000..837e8fc
--- /dev/null
+++ b/www/blackberry10/requestAllFileSystems.js
@@ -0,0 +1,42 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+/* 
+ * requestAllFileSystems
+ * 
+ * IN - no arguments
+ * OUT
+ *  success - Array of FileSystems
+ *   - filesystemName
+ *   - fullPath
+ *   - name
+ *   - nativeURL
+ */
+
+var info = require('org.apache.cordova.file.bb10FileSystemInfo');
+
+module.exports = function (success, fail, args) {
+    success([
+        { filesystemName: 'persistent', name: 'persistent', fullPath: '/', nativeURL: info.persistentPath + '/' },
+        { filesystemName: 'temporary', name: 'temporary', fullPath: '/', nativeURL: info.temporaryPath + '/' },
+        { filesystemName: 'root', name: 'root', fullPath: '/', nativeURL: 'file:///' }
+    ]);
+}

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/bff46b6f/www/blackberry10/requestAnimationFrame.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/requestAnimationFrame.js b/www/blackberry10/requestAnimationFrame.js
new file mode 100644
index 0000000..aac0a4a
--- /dev/null
+++ b/www/blackberry10/requestAnimationFrame.js
@@ -0,0 +1,38 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+/*
+ * requestAnimationFrame
+ * 
+ * This is used throughout the BB10 File implementation to wrap
+ * native webkit calls. There is a bug in the webkit implementation
+ * which causes callbacks to never return when multiple file system
+ * APIs are called in sequence. This should also make the UI more
+ * responsive during file operations.
+ * 
+ * Supported on BB10 OS > 10.1
+ */
+
+var requestAnimationFrame = window.requestAnimationFrame;
+if (typeof(requestAnimationFrame) !== 'function') {
+    requestAnimationFrame = function (cb) { cb(); };
+}
+module.exports = requestAnimationFrame;