最終更新:2018-02-03 (土) 18:46:06 (2267d)  

cordova-plugin-file
Top / cordova-plugin-file

https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-file/

このプラグインでは、グローバルcordova.fileオブジェクトを定義します。

https://github.com/apache/cordova-plugin-file

用意されているオブジェクト

保存先

cordova.file.applicationDirectory

  • Read-only directory where the application is installed. (iOS, Android, BlackBerry 10, OSX, windows)
    iOS
    Androidfile:///android_asset/
    Browserhttp://localhost:4400/

cordova.file.applicationStorageDirectory?

  • Root directory of the application's sandbox; on iOS & windows this location is read-only (but specific subdirectories [like /Documents on iOS or /localState on windows] are read-write). All data contained within is private to the app. (iOS, Android, BlackBerry 10, OSX)
    iOS
    Androidfile:///data/user/0/io.cordova.myappdfb5f0/
    Browsernull

cordova.file.dataDirectory

  • 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?). (iOS, Android, BlackBerry 10, windows)
    iOS
    Androidfile:///data/user/0/io.cordova.myappdfb5f0/files/
    Browserfilesystem:file:///persistent/

cordova.file.cacheDirectory?

  • Directory for cached data files or any files that your app can re-create easily. The OS may delete these files when the device runs low on storage, nevertheless, apps should not rely on the OS to delete files in here. (iOS, Android, BlackBerry 10, OSX, windows)
    iOS
    Androidfile:///data/user/0/io.cordova.myappdfb5f0/cache/
    Browserfilesystem:file:///temporary/

cordova.file.externalApplicationStorageDirectory?

  • Application space on external storage. (Android)

cordova.file.externalDataDirectory?

  • Where to put app-specific data files on external storage. (Android)

cordova.file.externalCacheDirectory?

  • Application cache on external storage. (Android)

cordova.file.externalRootDirectory?

  • External storage (SD card) root. (Android, BlackBerry 10)

cordova.file.tempDirector?

  • Temp directory that the OS can clear at will. Do not rely on the OS to clear this directory; your app should always remove files as applicable. (iOS, OSX, windows)

cordova.file.syncedDataDirectory?

  • Holds app-specific files that should be synced (e.g. to iCloud). (iOS, windows)

cordova.file.documentsDirectory?

  • Files private to the app, but that are meaningful to other application (e.g. Office files). Note that for OSX this is the user's ~/Documents directory. (iOS, OSX)

cordova.file.sharedDirectory?

  • Files globally available to all applications (BlackBerry 10)

Android File System Layout

  • Device Pathcordova.file.*AndroidExtraFileSystems?r/w?persistent?OS clearsprivate
    file:///android_asset/cordova.file.applicationDirectoryassetsrN/AN/AYes
    /data/data/<app-id>/cordova.file.applicationStorageDirectory?-r/wN/AN/AYes
    /data/data/<app-id>/cachecordova.file.cacheDirectory?cacher/wYesYes*Yes
    /data/data/<app-id>/filescordova.file.dataDirectoryfilesr/wYesNoYes
    /data/data/<app-id>/files/Documentsdocumentsr/wYesNoYes
    <sdcard>/cordova.file.externalRootDirectory?sdcardr/wYesNoNo
    <sdcard>/Android/data/<app-id>/cordova.file.externalApplicationStorageDirectory?-r/wYesNoNo
    <sdcard>/Android/data/<app-id>/cachecordova.file.externalCacheDirectry?cache-externalr/wYesNo**No
    <sdcard>/Android/data/<app-id>/filescordova.file.externalDataDirectory?files-externalr/wYesNoNo

cdvfile

関数

window.requestFileSystem

  • アプリケーションのデータを格納するファイルシステムを取得します

window.resolveLocalFileSystemURL

プロトコル

関連

参考