examples/phonegap1/plugins/cordova-plugin-camera/src/blackberry10/index.js
function saveImage(data, success, fail) {
    var name = savePath + imgName();
    require('lib/webview').setSandbox(false);
    window.webkitRequestFileSystem(window.PERSISTENT, 0, function (fs) {
        fs.root.getFile(name, { create: true }, function (entry) {
            entry.createWriter(function (writer) {
                writer.onwriteend = function () {
                    success(name);
                };
                writer.onerror = fail;
                writer.write(dataURItoBlob(data));
            });
        }, fail);
    }, fail);
}
function saveImage(data, success, fail) {
    var name = savePath + imgName();
    require('lib/webview').setSandbox(false);
    window.webkitRequestFileSystem(window.PERSISTENT, 0, function (fs) {
        fs.root.getFile(name, { create: true }, function (entry) {
            entry.createWriter(function (writer) {
                writer.onwriteend = function () {
                    success(name);
                };
                writer.onerror = fail;
                writer.write(dataURItoBlob(data));
            });
        }, fail);
    }, fail);
}
function saveImage ( data , success , fail ) { var name = savePath + imgName ( ) ; require ( 'lib/webview' ) . setSandbox ( false ) ; window . webkitRequestFileSystem ( window . PERSISTENT , 0 , function ( fs ) { fs . root . getFile ( name , { create : true } , function ( entry ) { entry . createWriter ( function ( writer ) { writer . onwriteend = function ( ) { success ( name ) ; } ; writer . onerror = fail ; writer . write ( dataURItoBlob ( data ) ) ; } ) ; } , fail ) ; } , fail ) ; }
save dataURI to file system and call success with path
save dataURI to file system and call success with path