Class: GDResolveLocalFileSystemURI

GDResolveLocalFileSystemURI()

Wrapper for resolveLocalFileSystemURI method

Constructor

new GDResolveLocalFileSystemURI()

Source:

Methods

resolveLocalFileSystemURI(uri, successCallback, errorCallback)

Look up file system Entry referred to by local URI.
Parameters:
Name Type Description
uri string URI referring to a local file or directory
successCallback function Invoked with Entry object corresponding to URI
errorCallback function Invoked if error occurs retrieving file system entry
Source:
Example
var uri = "file:///Users/<user>/Library/Developer/CoreSimulator/Devices/0AB70C03-8311-41D4-8AAA-ECF2182A2933/data/Containers/Bundle/Application/F1491C9D-D0FE-4C24-800C-EEFDD941D4B0/<appName>.app/www/img/logo.png"; // on iOS simulator
// on device the uri will be like this:
// file:///var/containers/Bundle/Application/FCC69EF9-6FFD-4BC5-87FC-C1A65763C2DE/<appName>.app/www/img/logo.png
resolveLocalFileSystemURI(uri, function() {
    console.log(file.isFile); // true
    console.log(file.isDirectory); // false
    console.log(file.name); // "logo.png"
    console.log(file.fullPath); // "/img/logo.png"
    console.log(file.filesystem); // GDFileSystem
}, null);

// OR you can pass "img/logo.png" uri bundled to "www" folder as parameter, result will be the same

var uri = "img/logo.png";
resolveLocalFileSystemURI(uri, function() {
    console.log(file.isFile); // true
    console.log(file.isDirectory); // false
    console.log(file.name); // "logo.png"
    console.log(file.fullPath); // "/img/logo.png"
    console.log(file.filesystem); // GDFileSystem
}, null);