So, I agree the wording on this is fuzzy at best and certainly misleading. Having done native development, I'm already accustomed to the quirks of the iOS file system, and so back-read this knowledge into the docs. Even so, the docs should certainly be updated to include a note that
cordova.file.applicationStorageDirectory is read-only (at least for iOS). It might be better worded as "the root directory of the application's sandbox; on iOS this location is read-only (but specific subdirectories [Documents, Caches, tmp] are read-write). All data contained within is private to the app."
dataDirectory could be worded "persistent and private data storage within the application's sandbox using internal memory (on Android, if you need to use external memory, use
externalDataDirectory). On iOS, this directory is not synced with iCloud (use
syncedDataDirectory)." Or some such.
As for private data on android: the data in internal storage (not on the sdcard) should be sandboxed (unless rooted and superuser), right? Although which persistent store for the file API is used depends on a setting in config.xml, I /would/ expect that dataDirectory would be /data/data (and private) whereas externalDataDirectory would be on the sdcard (and public). I should play with this more.
It would be nice if the docs would describe the hierarchy a bit, like this (for iOS, IIRC):
Directory Path cordova.file property read-write persistent? OS may clear? sync? private?
/var/mobile/Applications/uuid/ applicationStorageDirectory (r/o) N/A N/A N/A Yes
www/ - (r/o)
Documents/ documentsDirectory (r/w) Yes No Yes Yes
Library/ - (r/w)
NoCloud/ dataDirectory (r/w) Yes No No Yes
Cloud/ syncedDataDirectory (r/w) Yes No Yes Yes
Caches/ cacheDirectory (r/w) Yes* Yes*** No Yes
tmp/ tempDirectory (r/w) No** Yes*** No Yes
* Files persist across app restarts and upgrades, but this directory can be cleared whenever the OS desires. Your app should
be able to recreate any content that might be deleted.
** Files may persist across app restarts, but do not rely on this behavior. Files are not guaranteed to persist across updates.
Your app should remove files from this directory when it is applicable, as the OS does not guarantee when (or even if) these
files are removed.
*** The OS may clear the contents of this directory whenever it feels it is necessary, but do not rely on this. You should clear
this directory as appropriate for your application.