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/09/02 18:32:11 UTC

git commit: CB-7445 [BlackBerry10] Add default file system size to prevent quota exceeded error on initial install

Repository: cordova-plugin-file
Updated Branches:
  refs/heads/master 5cb702ce2 -> ca5b94759


CB-7445 [BlackBerry10] Add default file system size to prevent quota exceeded error on initial install


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/ca5b9475
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/tree/ca5b9475
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/diff/ca5b9475

Branch: refs/heads/master
Commit: ca5b947595820dc143e92e13ec6014b93bce4560
Parents: 5cb702c
Author: Bryan Higgins <bh...@blackberry.com>
Authored: Tue Sep 2 12:30:53 2014 -0400
Committer: Bryan Higgins <bh...@blackberry.com>
Committed: Tue Sep 2 12:30:53 2014 -0400

----------------------------------------------------------------------
 www/blackberry10/resolveLocalFileSystemURI.js | 3 ++-
 www/blackberry10/write.js                     | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/ca5b9475/www/blackberry10/resolveLocalFileSystemURI.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/resolveLocalFileSystemURI.js b/www/blackberry10/resolveLocalFileSystemURI.js
index 058d76a..5f144e4 100644
--- a/www/blackberry10/resolveLocalFileSystemURI.js
+++ b/www/blackberry10/resolveLocalFileSystemURI.js
@@ -41,6 +41,7 @@
 var info = require('org.apache.cordova.file.bb10FileSystemInfo'),
     requestAnimationFrame = cordova.require('org.apache.cordova.file.bb10RequestAnimationFrame'),
     createEntryFromNative = require('org.apache.cordova.file.bb10CreateEntryFromNative'),
+    DEFAULT_SIZE = 5*1024*1024,
     SANDBOXED = true,
     UNSANDBOXED = false;
 
@@ -110,7 +111,7 @@ function resolveLocal(success, fail, request, options) {
 //validate parameters and set sandbox
 function resolve(success, fail, path, fsType, sandbox, options, size) {
     options = options || { create: false };
-    size = size || 0;
+    size = size || DEFAULT_SIZE;
     if (size > info.MAX_SIZE) {
         //bb10 does not respect quota; fail at unreasonably large size
         fail(FileError.QUOTA_EXCEEDED_ERR);

http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/ca5b9475/www/blackberry10/write.js
----------------------------------------------------------------------
diff --git a/www/blackberry10/write.js b/www/blackberry10/write.js
index 1b31bb2..b8df14c 100644
--- a/www/blackberry10/write.js
+++ b/www/blackberry10/write.js
@@ -50,6 +50,8 @@ module.exports = function (success, fail, args) {
             if (typeof fail === 'function') {
                 if (error && error.code) {
                     fail(error.code);
+                } else if (error && error.target && error.target.code) {
+                    fail(error.target.code);
                 } else {
                     fail(error);
                 }