Lisa testing pulling in plugins for plugin: cordova-plugin-file
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/commit/d73a602f Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/tree/d73a602f Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/diff/d73a602f Branch: refs/heads/master Commit: d73a602f152ee028da270f6d31b1277280e4541f Parents: d2fcdc1 Author: ldeluca <[email protected]> Authored: Tue May 27 17:49:28 2014 -0400 Committer: ldeluca <[email protected]> Committed: Tue May 27 17:49:28 2014 -0400 ---------------------------------------------------------------------- doc/ja/index.md | 175 +++++++++++++++++++++++++++++++++++++++++++++++++ doc/ja/plugins.md | 124 +++++++++++++++++++++++++++++++++++ 2 files changed, 299 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/d73a602f/doc/ja/index.md ---------------------------------------------------------------------- diff --git a/doc/ja/index.md b/doc/ja/index.md new file mode 100644 index 0000000..4351109 --- /dev/null +++ b/doc/ja/index.md @@ -0,0 +1,175 @@ +<!--- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> + +# org.apache.cordova.file + +This plugin provides the [HTML5 Filesystem API][1]. For usage, refer to HTML5 Rocks' [FileSystem article][2] on the subject. For an overview of other storage options, refer to Cordova's [storage guide][3]. + + [1]: http://dev.w3.org/2009/dap/file-system/pub/FileSystem/ + [2]: http://www.html5rocks.com/en/tutorials/file/filesystem/ + [3]: http://cordova.apache.org/docs/en/edge/cordova_storage_storage.md.html + +## ã¤ã³ã¹ãã¼ã« + + cordova plugin add org.apache.cordova.file + + +## ãµãã¼ãããã¦ãããã©ãããã©ã¼ã + +* ã¢ãã¾ã³ç« OS +* ã¢ã³ããã¤ã +* BlackBerry 10* +* iOS +* Windows Phone 7 and 8* +* Windows 8* + +* *These platforms do not support `FileReader.readAsArrayBuffer` nor `FileWriter.write(blob)`.* + +## Configuring the Plugin + +å©ç¨å¯è½ãªãã¡ã¤ã«ã·ã¹ãã ã®ã»ããã¯æ§æããããã©ãããã©ã¼ã ããããã¨ãã§ãã¾ããIOS 㨠Android ã®ä¸¡æ¹ãèªèãã¾ãã <preference> ã¿ã°ã® `config.xml` ãã¤ã³ã¹ãã¼ã«ãããã¡ã¤ã«ã·ã¹ãã ã®ååãã¾ããæ¢å®ã§ã¯ããã¹ã¦ã®ãã¡ã¤ã« ã·ã¹ãã ã®ã«ã¼ããæå¹ã«ãªãã¾ãã + + <preference name="iosExtraFilesystems" value="library,library-nosync,documents,documents-nosync,cache,bundle,root" /> + <preference name="AndroidExtraFilesystems" value="files,files-external,documents,sdcard,cache,cache-external,root" /> + + +### ã¢ã³ããã¤ã + +* ãã¡ã¤ã«ï¼ ã¢ããªã±ã¼ã·ã§ã³ã®å é¨ãã¡ã¤ã«ã®ã¹ãã¬ã¼ã¸ ãã£ã¬ã¯ã㪠+* å¤é¨ãã¡ã¤ã«: ã¢ããªã±ã¼ã·ã§ã³ã®å¤é¨ã®ãã¡ã¤ã«ã®ã¹ãã¬ã¼ã¸ ãã£ã¬ã¯ã㪠+* sdcard: The global external file storage directory (this is the root of the SD card, if one is installed) +* cache: The application's internal cache directory +* cache-external: The application's external cache directory +* root: The entire device filesystem + +Android also supports a special filesystem named "documents", which represents a "/Documents/" subdirectory within the "files" filesystem. + +### iOS + +* library: The application's Library directory +* documents: The application's Documents directory +* cache: The application's Cache directory +* app-bundle: The application's bundle; the location of the app itself on disk +* root: The entire device filesystem + +By default, the library and documents directories can be synced to iCloud. You can also request two additional filesystems, "library-nosync" and "documents-nosync", which represent a special non-synced directory within the Library or Documents filesystem. + +## Android ã®ç + +### Android Persistent storage location + +There are multiple valid locations to store persistent files on an Android device. See [this page][4] for an extensive discussion of the various possibilities. + + [4]: http://developer.android.com/guide/topics/data/data-storage.html + +Previous versions of the plugin would choose the location of the temporary and persistent files on startup, based on whether the device claimed that the SD Card (or equivalent storage partition) was mounted. If the SD Card was mounted, or if a large internal storage partition was available (such as on Nexus devices,) then the persistent files would be stored in the root of that space. This meant that all Cordova apps could see all of the files available on the card. + +If the SD card was not available, then previous versions would store data under /data/data/<packageid>, which isolates apps from each other, but may still cause data to be shared between users. + +It is now possible to choose whether to store files in the internal file storage location, or using the previous logic, with a preference in your application's config.xml file. To do this, add one of these two lines to config.xml: + + <preference name="AndroidPersistentFileLocation" value="Internal" /> + + <preference name="AndroidPersistentFileLocation" value="Compatibility" /> + + +ãã®è¡ããªããã°ãã¡ã¤ã« ãã©ã°ã¤ã³ã¯æ¢å®å¤ã¨ãã¦ãäºææ§ãã使ç¨ãã¾ããåªå ã¿ã°ãåå¨ãããããã®å¤ã® 1 ã¤ã§ã¯ãªãå ´åãã¢ããªã±ã¼ã·ã§ã³ã¯èµ·åãã¾ããã + +ã¢ããªã±ã¼ã·ã§ã³ã¯ãã¦ã¼ã¶ã¼ã«ä»¥ååºè·ããã¦ããå ´åãå¤ã (å 1.0ï¼ ã使ç¨ãã¦ããã®ãã©ã°ã¤ã³ã®ãã¼ã¸ã§ã³ããæ°¸ç¶çãªãã¡ã¤ã«ã·ã¹ãã ã«ä¿åããã¦ãããã¡ã¤ã«ã«ã¯ãäºææ§ããè¨å®ããå¿ è¦ãããã¾ãã èªåã®ã¢ããªã±ã¼ã·ã§ã³ãã¢ããã°ã¬ã¼ãããæ¢åã®ã¦ã¼ã¶ã¼ãå½¼ãã®è£ ç½®ã«ãã£ã¦ã以åã«ä¿åããããã¡ã¤ã«ã«ã¢ã¯ã»ã¹ãããã¨ãã§ãããã¨ããããã¨ãæå³ãããå é¨ãã«å ´æãã¹ã¤ããã³ã°ãã¾ãã + +ã¢ããªã±ã¼ã·ã§ã³å ´åã¯ãæ°ãããã¾ãã¯æ°¸ç¶çãªãã¡ã¤ã«ã·ã¹ãã ã«ãã¡ã¤ã«ãæ ¼ç´ãã以åã¯æ±ºãã¦ããå é¨ãã®è¨å®ã¯æ¨å¥¨ä¸è¬ã«ã + +## ãã©ãã¯ããªã¼ã®ç + +`DirectoryEntry.removeRecursively()`失æããå¯è½æ§ãããã¾ãã `ControlledAccessException` ãæ¬¡ã®å ´åã + +* ã¢ããªã¯ãã¢ããªã®ä»¥åã®ã¤ã³ã¹ãã¼ã«ã«ãã£ã¦ä½æããããã£ã¬ã¯ããªã«ã¢ã¯ã»ã¹ãããã¨ãã¾ãã + +> 解決ç: æåã§ãã¾ãã¯åã¤ã³ã¹ãã¼ã«ããåã«ã¢ããªã±ã¼ã·ã§ã³ã«ãã£ã¦ä¸æãã£ã¬ã¯ããªã¯ãããã«ç¢ºèªãã¦ãã ããã + +* å ´åã¯ãããã¤ã¹ã¯ USB ã§æ¥ç¶ããã¾ããã + +> ã½ãªã¥ã¼ã·ã§ã³: åå®è¡ãã¦ãããã¤ã¹ãã USB ã±ã¼ãã«ãå¤ãã¾ãã + +## iOS ã®ç + +* `FileReader.readAsText(blob, encoding)` + * `encoding`ãã©ã¡ã¼ã¿ã¼ã¯ãµãã¼ãããã¦ãã¾ããããutf-8 ã¨ã³ã³ã¼ãã£ã³ã°ãå¸¸ã«æå¹ã§ãã + +### iOS ã®æ°¸ç¶çãªã¹ãã¬ã¼ã¸ã®å ´æ + +IOS ããã¤ã¹ã«æ°¸ç¶çãªãã¡ã¤ã«ãæ ¼ç´ãã 2 ã¤ã®æå¹ãªå ´æããã: ããã¥ã¡ã³ãã¨ã©ã¤ãã©ãªã®ãã£ã¬ã¯ããªã ãã©ã°ã¤ã³ã®ä»¥åã®ãã¼ã¸ã§ã³ã¯ãå¯ä¸ã®ããã¾ã§ããã¥ã¡ã³ã ãã£ã¬ã¯ããªã«æ°¸ç¶çãªãã¡ã¤ã«ãæ ¼ç´ããã¾ãã ããã¯ããã£ã¬ã¯ããªã®ç®çã¯ã輸åºã®ããã®å®å ¨ãªããã¥ã¡ã³ãã使ããã®ã§ã¯ãªããªãã£ãããã°ãã°æå³ããã¦ããããç¹ã«å¤æ°ã®å°ãããã¡ã¤ã«ãå¦çããã¢ããªã±ã¼ã·ã§ã³ã®å ´åãiTunes ã«è¡¨ç¤ºããã¦ãããã¹ã¦ã®ã¢ããªã±ã¼ã·ã§ã³ã®ãã¡ã¤ã«ãä½ãã®å¯ä½ç¨ããã£ãã + +ããã¥ã¡ã³ãã¾ãã¯ã¢ããªã±ã¼ã·ã§ã³ã® config.xml ãã¡ã¤ã«ã«åªå é ä½ã®ã©ã¤ãã©ãª ãã£ã¬ã¯ããªã«ãã¡ã¤ã«ãä¿åãããã©ããã鏿ãããã¨ãå¯è½ã§ãä»ã ãããè¡ãã«ãconfig.xml ã«æ¬¡ã® 2 è¡ã®ããããã追å ãã¾ãã + + <preference name="iosPersistentFileLocation" value="Library" /> + + <preference name="iosPersistentFileLocation" value="Compatibility" /> + + +ãã®è¡ããªããã°ãã¡ã¤ã« ãã©ã°ã¤ã³ã¯æ¢å®å¤ã¨ãã¦ãäºææ§ãã使ç¨ãã¾ããåªå ã¿ã°ãåå¨ãããããã®å¤ã® 1 ã¤ã§ã¯ãªãå ´åãã¢ããªã±ã¼ã·ã§ã³ã¯èµ·åãã¾ããã + +ã¢ããªã±ã¼ã·ã§ã³ã¯ãã¦ã¼ã¶ã¼ã«ä»¥ååºè·ããã¦ããå ´åãå¤ã (å 1.0ï¼ ã使ç¨ãã¦ããã®ãã©ã°ã¤ã³ã®ãã¼ã¸ã§ã³ããæ°¸ç¶çãªãã¡ã¤ã«ã·ã¹ãã ã«ä¿åããã¦ãããã¡ã¤ã«ã«ã¯ãäºææ§ããè¨å®ããå¿ è¦ãããã¾ãã èªåã®ã¢ããªã±ã¼ã·ã§ã³ãã¢ããã°ã¬ã¼ãããæ¢åã®ã¦ã¼ã¶ã¼ã以åã«ä¿åããããã¡ã¤ã«ã«ã¢ã¯ã»ã¹ãããã¨ãã§ããã ãããã¨ãæå³ãããã©ã¤ãã©ãªãã«å ´æãã¹ã¤ããã³ã°ãã¾ãã + +ã¢ããªã±ã¼ã·ã§ã³å ´åã¯ãæ°ãããã¾ãã¯æ°¸ç¶çãªãã¡ã¤ã«ã·ã¹ãã ã«ãã¡ã¤ã«ãæ ¼ç´ãã以åã¯æ±ºãã¦ããã©ã¤ãã©ãªãè¨å®ã¯æ¨å¥¨ä¸è¬ã«ã + +## ãã¼ããã¢ããã°ã¬ã¼ããã¾ãã + +ãã®ãã©ã°ã¤ã³ã®ãããããã¼ã§ã `FileEntry` 㨠`DirectoryEntry` æ§é 夿´ãå ¬éããã仿§ã«æ²¿ã£ãããå¤ãã§ããã¾ãã + +ãã©ã°ã¤ã³ã®å (pre 1.0.0) ãã¼ã¸ã§ã³ãããã¤ã¹-絶対-ãã¡ã¤ã«ã®å ´æã«æ ¼ç´ããã¦ããã `fullPath` ã®ãããã㣠`Entry` ãªãã¸ã§ã¯ãããããã®ãã¹ã¯ããã«ãªãã¾ãé常 + + /var/mobile/Applications/<application UUID>/Documents/path/to/file (iOS) + /storage/emulated/0/path/to/file (Android) + + +ãããã®ãã¹ã¯ã¾ãã«ãã£ã¦è¿ãããã `toURL()` æ³ã `Entry` ãªãã¸ã§ã¯ãã + +ãããããã¼ã¨ã `fullPath` 屿§ã¯ã *HTML ã®ãã¡ã¤ã«ã·ã¹ãã ã®ã«ã¼ãã«å¯¾ããç¸å¯¾ãã¹*ã®ãã¡ã¤ã«ã¸ã®ãã¹ã ãããã£ã¦ãä¸è¨ã®ãã¹ã¯ä¸¡æ¹ã«ãã£ã¦è¡¨ãããä»ã `FileEntry` ãªãã¸ã§ã¯ããã `fullPath` ã® + + /path/to/file + + +If your application works with device-absolute-paths, and you previously retrieved those paths through the `fullPath` property of `Entry` objects, then you should update your code to use `entry.toURL()` instead. ãã®ã¡ã½ããã¯ããã©ã¼ã ã®ãã¡ã¤ã«ã·ã¹ãã ã® Url ãè¿ãã¾ãä» + + cdvfile://localhost/persistent/path/to/file + + +which can be used to identify the file uniquely. + +For backwards compatibility, the `resolveLocalFileSystemURL()` method will accept a device-absolute-path, and will return an `Entry` object corresponding to it, as long as that file exists within either the TEMPORARY or PERSISTENT filesystems. + +ããã¯ç¹ã«ä»¥åããã¤ã¹çµ¶å¯¾ãã¹ã使ç¨ãã¦ãã¡ã¤ã«è»¢éã®ãã©ã°ã¤ã³ã§åé¡ã¨ãªã£ã¦ãã ï¼ããã¦ã¾ã ããããåãå ¥ãããã¨ãã§ãã¾ãï¼ã ã®ã§äº¤æããã¡ã¤ã«ã·ã¹ãã ã® Url ã§æ£ããåä½ããããã«æ´æ°ããã¦ãã `entry.fullPath` 㨠`entry.toURL()` ããã¤ã¹ä¸ã®ãã¡ã¤ã«ã§åä½ãããã©ã°ã¤ã³ãå¾ã¦åé¡ã解決ããå¿ è¦ãããã¾ãã + +## ã¨ã©ã¼ ã³ã¼ãã¨æå³ã®ãªã¹ã + +ã¨ã©ã¼ãã¹ãã¼ãããã¨ã次ã®ã³ã¼ãã®ããããã使ç¨ããã¾ãã + +* 1 = NOT\_FOUND\_ERR +* 2 = SECURITY_ERR +* 3 = ABORT_ERR +* 4 = NOT\_READABLE\_ERR +* 5 = ENCODING_ERR +* 6 = NO\_MODIFICATION\_ALLOWED_ERR +* 7 = INVALID\_STATE\_ERR +* 8 = SYNTAX_ERR +* 9 = INVALID\_MODIFICATION\_ERR +* 10 = QUOTA\_EXCEEDED\_ERR +* 11 = TYPE\_MISMATCH\_ERR +* 12 = PATH\_EXISTS\_ERR \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/d73a602f/doc/ja/plugins.md ---------------------------------------------------------------------- diff --git a/doc/ja/plugins.md b/doc/ja/plugins.md new file mode 100644 index 0000000..1a0efa1 --- /dev/null +++ b/doc/ja/plugins.md @@ -0,0 +1,124 @@ +<!--- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> + +# Notes for plugin developers + +ãããã®ãã¼ãã¯ã主ã«äººé 人é㨠iOS éçºè åããã¡ã¤ã«ã®ãã©ã°ã¤ã³ã使ç¨ãã¦ããã¡ã¤ã« ã·ã¹ãã ã§ãã©ã°ã¤ã³ã®ã¤ã³ã¿ã¼ãã§ã¤ã¹ãè¨è¿°ãããã®ã + +## ã³ã«ããã®ãã¡ã¤ã« ã·ã¹ãã ã® Url ã®æä½ + +ãã¼ã¸ã§ã³ 1.0.0 以éãã®ãã©ã°ã¤ã³ã使ç¨ãã Url ã¨ã¯ `cdvfile` raw ããã¤ã¹ ãã¡ã¤ã« ã·ã¹ãã ãã¹ã JavaScript ã«å ¬éããã®ã§ã¯ãªããããªãã¸ä¸ã®ãã¹ã¦ã®éä¿¡æ¹å¼ãã¾ãã + +JavaScript å´èªè¨¼ã¨ DirectoryEntry ãªãã¸ã§ã¯ãã® HTML ãã¡ã¤ã« ã·ã¹ãã ã®ã«ã¼ãããã®ç¸å¯¾ã§ãã fullPath 屿§ããããã¨ãæå³ãã¾ãã å¼ã³åºãå¿ è¦ãããã¾ããã©ã°ã¤ã³ã® JavaScript API ã¯ãèªè¨¼ã¾ã㯠DirectoryEntry ãªãã¸ã§ã¯ããåãå ¥ããå ´å `.toURL()` ãæ©ãæ¸¡ã£ã¦ãã¤ãã£ã ã³ã¼ãã«æ¸¡ãåã«ããã®ãªãã¸ã§ã¯ãã + +### Cdvfile ã夿ããï¼//fileystem ã®ãã¹ã« Url + +ãã¡ã¤ã«ã·ã¹ãã ã¸ã®æ¸ãè¾¼ã¿ããå¿ è¦ããããã©ã°ã¤ã³ã¯å®éã®ãã¡ã¤ã«ã·ã¹ãã ã®å ´æã«åä¿¡ãã¡ã¤ã«ç¨ã® URL ã夿ãããå¯è½æ§ãããã¾ãããã¤ãã£ãã®ãã©ãããã©ã¼ã ã«ãã£ã¦ããããè¡ãããã®è¤æ°ã®æ¹æ³ãããã¾ãã + +è¦ãã¦ãããã¨ãéè¦ã§ããã¹ã¦ã§ã¯ãªã `cdvfile://` ã® Url ã¯ããã¤ã¹ä¸ã®å®éã®ãã¡ã¤ã«ããããã³ã°å¯è½ãªã ããã¤ãã® Url ã¯ããã¡ã¤ã«ã§ã¯è¡¨ãããªãã¾ãã¯ãªã¢ã¼ãã®ãªã½ã¼ã¹ãåç §ãããã¨ãã§ãã¾ãããããã¤ã¹ä¸ã®è³ç£ãåç §ã§ãã¾ãã ãã©ã°ã¤ã³ã¯ãããã®å¯è½æ§ã®ããã«å½¼ãã® Url ãã¹ã«å¤æãããããã¨ãã¦ããã¨ãã«æ»ã£ã¦ãææç¾©ãªçµæãå¾ããã©ãã常ã«ãã¹ãå¿ è¦ãããã¾ãã + +#### ã¢ã³ããã¤ã + +Android ä¸ã§å¤æããæãç°¡åãªæ¹æ³ã¯ `cdvfile://` ã使ç¨ãã¦ãã¡ã¤ã«ã·ã¹ãã ã®ãã¹ã« URL ã `org.apache.cordova.CordovaResourceApi` ã `CordovaResourceApi`æ±ããã¨ãã§ããããã¤ãã®æ¹æ³ãããã¾ã `cdvfile://` Url: + + // webView is a member of the Plugin class + CordovaResourceApi resourceApi = webView.getResourceApi(); + + // Obtain a file:/// URL representing this file on the device, + // or the same URL unchanged if it cannot be mapped to a file + Uri fileURL = resourceApi.remapUri(Uri.parse(cdvfileURL)); + + +ã¾ãããã¡ã¤ã« ãã©ã°ã¤ã³ãç´æ¥ä½¿ç¨ãããã¨ãå¯è½ã§ãã + + import org.apache.cordova.file.FileUtils; + import org.apache.cordova.file.FileSystem; + import java.net.MalformedURLException; + + // Get the File plugin from the plugin manager + FileUtils filePlugin = (FileUtils)webView.pluginManager.getPlugin("File"); + + // Given a URL, get a path for it + try { + String path = filePlugin.filesystemPathForURL(cdvfileURL); + } catch (MalformedURLException e) { + // The filesystem url wasn't recognized + } + + +ãã¹ãã夿ããã `cdvfile://` ã® URL: + + import org.apache.cordova.file.LocalFilesystemURL; + + // Get a LocalFilesystemURL object for a device path, + // or null if it cannot be represented as a cdvfile URL. + LocalFilesystemURL url = filePlugin.filesystemURLforLocalPath(path); + // Get the string representation of the URL object + String cdvfileURL = url.toString(); + + +ããªãã®ãã©ã°ã¤ã³ã¯ããã¡ã¤ã«ã使ããèªè¨¼ãªãã¸ã§ã¯ããè¿ãå ´åãã¡ã¤ã«ã®ãã©ã°ã¤ã³ã使ç¨ï¼ + + // Return a JSON structure suitable for returning to JavaScript, + // or null if this file is not representable as a cdvfile URL. + JSONObject entry = filePlugin.getEntryForFile(file); + + +#### iOS + +IOS ã«ã³ã«ããã¨åã使ç¨ããªã `CordovaResourceApi` ã¢ã³ããã¤ãã¨ãã¦æ¦å¿µãIOSãä¸ãã¡ã¤ã« ãã©ã°ã¤ã³ã使ç¨ã㦠Url ããã¡ã¤ã«ã·ã¹ãã ã®ãã¹ã«å¤æããå¿ è¦ãããã¾ãã + + // Get a CDVFilesystem URL object from a URL string + CDVFilesystemURL* url = [CDVFilesystemURL fileSystemURLWithString:cdvfileURL]; + // Get a path for the URL object, or nil if it cannot be mapped to a file + NSString* path = [filePlugin filesystemPathForURL:url]; + + + // Get a CDVFilesystem URL object for a device path, or + // nil if it cannot be represented as a cdvfile URL. + CDVFilesystemURL* url = [filePlugin fileSystemURLforLocalPath:path]; + // Get the string representation of the URL object + NSString* cdvfileURL = [url absoluteString]; + + +ããªãã®ãã©ã°ã¤ã³ã¯ããã¡ã¤ã«ã使ããèªè¨¼ãªãã¸ã§ã¯ããè¿ãå ´åãã¡ã¤ã«ã®ãã©ã°ã¤ã³ã使ç¨ï¼ + + // Get a CDVFilesystem URL object for a device path, or + // nil if it cannot be represented as a cdvfile URL. + CDVFilesystemURL* url = [filePlugin fileSystemURLforLocalPath:path]; + // Get a structure to return to JavaScript + NSDictionary* entry = [filePlugin makeEntryForLocalURL:url] + + +#### Java ã¹ã¯ãªããã®è¨å® + +Java ã¹ã¯ãªããã®è¨å®ãåå¾ããã«ã¯ `cdvfile://` èªè¨¼ã¾ã㯠DirectoryEntry ãªãã¸ã§ã¯ããã URL ãåã«å¼ã³åºã `.toURL()` ã«ï¼ + + var cdvfileURL = entry.toURL(); + + +ãã©ã°ã¤ã³ãã³ãã©ã¼ã®å¿çã§è¿ããã FileEntry æ§é ä½ã®å®éã®ã¨ã³ã㪠ãªãã¸ã§ã¯ãã夿ãããã³ãã©ã¼ã®ã³ã¼ãããå¿ è¦ãããã¾ããã¡ã¤ã« ãã©ã°ã¤ã³ãã¤ã³ãã¼ãããæ°ãããªãã¸ã§ã¯ãã使ãã¾ãã + + // create appropriate Entry object + var entry; + if (entryStruct.isDirectory) { + entry = new DirectoryEntry(entryStruct.name, entryStruct.fullPath, new FileSystem(entryStruct.filesystemName)); + } else { + entry = new FileEntry(entryStruct.name, entryStruct.fullPath, new FileSystem(entryStruct.filesystemName)); + } \ No newline at end of file
