How to use the cordova-plugin-file.bb10FileSystemInfo.MAX_SIZE function in cordova-plugin-file

To help you get started, we’ve selected a few cordova-plugin-file examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github apache / cordova-plugin-file / www / blackberry10 / resolveLocalFileSystemURI.js View on Github external
function resolve (success, fail, path, fsType, sandbox, options, size) {
    options = options || { create: false };
    size = size || info.MAX_SIZE;
    if (size > info.MAX_SIZE) {
        // bb10 does not respect quota; fail at unreasonably large size
        fail(FileError.QUOTA_EXCEEDED_ERR); // eslint-disable-line no-undef
    } else if (path.indexOf(':') > -1) {
        // files with : character are not valid in Cordova apps
        fail(FileError.ENCODING_ERR); // eslint-disable-line no-undef
    } else {
        requestAnimationFrame(function () {
            cordova.exec(function () { // eslint-disable-line no-undef
                requestAnimationFrame(function () {
                    resolveNative(success, fail, path, fsType, options, size);
                });
            }, fail, 'File', 'setSandbox', [sandbox], false);
        });
    }
}
github apache / cordova-plugin-file / www / blackberry10 / resolveLocalFileSystemURI.js View on Github external
function resolve (success, fail, path, fsType, sandbox, options, size) {
    options = options || { create: false };
    size = size || info.MAX_SIZE;
    if (size > info.MAX_SIZE) {
        // bb10 does not respect quota; fail at unreasonably large size
        fail(FileError.QUOTA_EXCEEDED_ERR); // eslint-disable-line no-undef
    } else if (path.indexOf(':') > -1) {
        // files with : character are not valid in Cordova apps
        fail(FileError.ENCODING_ERR); // eslint-disable-line no-undef
    } else {
        requestAnimationFrame(function () {
            cordova.exec(function () { // eslint-disable-line no-undef
                requestAnimationFrame(function () {
                    resolveNative(success, fail, path, fsType, options, size);
                });
            }, fail, 'File', 'setSandbox', [sandbox], false);
        });
    }
}