I am just looking through the Cordova source code to try and figure something out, and there are currently six alternate methods/properties to access the path of a file.
Currently (running using iOS), there is:
// Properties
file.fullPath; // file:///full/path/syntax/file
file.nativeURL; // file:///full/path/syntax/file
// Method(s)
file.toInternalURL(); // formats the file.fullPath into a cdvfile://localhost/persisten/file.
file.toURL(); // if file.nativeURL is set, uses file.nativeURL, otherwise use file.toInternalURL() or file.fullPath.
// Deprecated method(s)
file.toURI(); // deprecated - calls file.toURL();
file.toNativeURL() // deprecated - calls file.toURL();
I understand two are deprecated - which both point to file.toURL() - so I can ignore them and focus on just four methods.
But what is the difference between file.fullPath and file.nativeURL - they are exactly the same? They are both properties on the file object - both publicly accessible.
As far as I can tell, file.toURL() uses both of these - first file.nativeURL if not that, then file.toInternalURL() or failing that, then file.fullPath.
Then finally, file.toNativeURL() returns a cdvfile:// formatted location.
So, most methods point to the file.nativeURL property. Is file.toURL() the method to use since it handles all instances? If so, then what on earth is cdvfile://?
Thanks