examples/phonegap1/plugins/cordova-plugin-file/www/blackberry10/resolveLocalFileSystemURI.js
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);
                                }
                            }
                        );
                    }
                );
            }
        }
    );
}
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);
                                }
                            }
                        );
                    }
                );
            }
        }
    );
}
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 ) ; } } ) ; } ) ; } } ) ; }
find path using webkit file system
find path using webkit file system