documentation translation: 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/4dce382c Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/tree/4dce382c Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/diff/4dce382c Branch: refs/heads/master Commit: 4dce382cb44ad07ada5511da704ed3ed5dee7295 Parents: 9f937b7 Author: ldeluca <[email protected]> Authored: Tue May 27 21:36:24 2014 -0400 Committer: ldeluca <[email protected]> Committed: Tue May 27 21:36:24 2014 -0400 ---------------------------------------------------------------------- doc/de/index.md | 201 +++++++++++++++++++++++++++++++++++++++++++++++++ doc/de/plugins.md | 124 ++++++++++++++++++++++++++++++ doc/ja/index.md | 124 ++++++++++++++++++------------ doc/ja/plugins.md | 2 +- 4 files changed, 401 insertions(+), 50 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/4dce382c/doc/de/index.md ---------------------------------------------------------------------- diff --git a/doc/de/index.md b/doc/de/index.md new file mode 100644 index 0000000..75b1cc5 --- /dev/null +++ b/doc/de/index.md @@ -0,0 +1,201 @@ +<!--- + 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 + +Dieses Plugin bietet die [HTML5-Dateisystem-API][1]. Verwendung finden Sie unter HTML5 Rocks [FileSystem-Artikel][2] zu diesem Thema. Finden Sie einen Ãberblick über andere Speicheroptionen Cordovas [Speicher-Führer][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 + +## Installation + + cordova plugin add org.apache.cordova.file + + +## Unterstützte Plattformen + +* Amazon Fire OS +* Android +* BlackBerry 10 +* iOS +* Windows Phone 7 und 8 * +* Windows 8 * +* Firefox OS + +* *Diese Plattformen unterstützen nicht `FileReader.readAsArrayBuffer` noch `FileWriter.write(blob)` .* + +## Wo Dateien gespeichert + +Stand: V1 werden URLs auf wichtige Datei-System-Verzeichnisse zur Verfügung gestellt. Jede URL in der Form *file:///path/to/spot/*ist, und konvertiert werden können eine `DirectoryEntry` mit`window.resolveLocalFileSystemURL()`. + +`cordova.file.applicationDirectory`-Die schreibgeschützten Verzeichnis, in dem die Anwendung installiert ist. (*iOS*, *Android*) + +`cordova.file.applicationStorageDirectory`-Stamm der app's private beschreibbaren Speicher. (*iOS*, *Android*) + +`cordova.file.dataDirectory`-Wo app-spezifische Datendateien zu setzen. (*iOS*, *Android*) + +`cordova.file.cacheDirectory`-Cache-Dateien, die app startet überleben sollte. Apps sollten nicht vom Betriebssystem zum Löschen von Dateien hier verlassen. (*iOS*, *Android*) + +`cordova.file.externalApplicationStorageDirectory`-Anwendungsraum auf externen Speicher. (*iOS*, *Android*) + +`cordova.file.externalDataDirectory`-Wo, app-spezifische Datendateien auf externen Speicher setzen. (*Android*) + +`cordova.file.externalCacheDirectory`-Anwendungscache auf externen Speicher. (*Android*) + +`cordova.file.externalRootDirectory`-Externer Speicher (SD-Karte) Stamm. (*Android*) + +`cordova.file.tempDirectory`-Temp-Verzeichnis, dem das OS auf deaktivieren können wird. (*iOS*) + +`cordova.file.syncedDataDirectory`-Hält app-spezifische Dateien, die (z. B. auf iCloud) synchronisiert werden sollten. (*iOS*) + +`cordova.file.documentsDirectory`-Dateien für die app, aber privat sind sinnvoll, andere Anwendungen (z.B. Office-Dateien). (*iOS*) + +## Android Macken + +### Android permanenten Speicherort + +Es gibt mehrere gültige Speicherorte, persistente Dateien auf einem Android-Gerät zu speichern. Finden Sie auf [dieser Seite][4] eine ausführliche Diskussion über die verschiedenen Möglichkeiten. + + [4]: http://developer.android.com/guide/topics/data/data-storage.html + +Frühere Versionen des Plugins wählen würde, den Speicherort der temporären und permanenten Dateien beim Start, basierend auf, ob das Gerät behauptete, dass die SD-Karte (oder gleichwertige Speicherpartition) bereitgestellt wurde. Wenn die SD-Karte eingelegt wurde, oder wenn eine groÃe interne Speicherpartition verfügbar war (wie auf Nexus-Geräten) und dann in die Wurzel dieses Raumes, die persistenten Dateien gespeichert werden. Dies bedeutete, dass alle Cordova apps aller verfügbaren Dateien auf der Karte sehen konnte. + +Wenn die SD-Karte nicht verfügbar war, würde dann frühere Versionen unter/Data/Data/Datenspeicher<packageid>, die apps von einander isoliert, kann aber noch Daten für Benutzer freigegeben werden. + +Es ist jetzt möglich, ob Sie Dateien der internen Datei-Speicherort oder unter Verwendung der bisherigen Logik, mit einer Präferenz in der Anwendung-config.xml-Datei speichern möchten. Hierzu fügen Sie eine dieser zwei Zeilen zu "config.xml": + + <preference name="AndroidPersistentFileLocation" value="Internal" /> + + <preference name="AndroidPersistentFileLocation" value="Compatibility" /> + + +Ohne diese Zeile wird die Datei-Erweiterung "Kompatibilität" als Standard verwenden. Wenn ein Präferenz-Tag vorhanden ist, und nicht einen der folgenden Werte, wird die Anwendung nicht gestartet. + +Wenn Ihre Anwendung für Benutzer zuvor versandt wird, mithilfe eines älteren (Pre-1.0) Version dieses Plugins und gespeicherte Dateien im permanenten Dateisystem hat, dann setzen Sie die Einstellung auf "Kompatibilität". Wechseln die Location auf "Internal" würde bedeuten, dass Benutzer, die aktualisieren Sie ihre Anwendung, möglicherweise nicht auf ihre zuvor gespeicherte Dateien, abhängig von ihrem Gerät zugreifen. + +Wenn Ihre Anwendung neu ist, oder nie zuvor Dateien im Dateisystem persistent gespeichert hat, wird die "interne" Einstellung im Allgemeinen empfohlen. + +## iOS Macken + +* `FileReader.readAsText(blob, encoding)` + * Die `encoding` Parameter wird nicht unterstützt und UTF-8-Kodierung ist immer wirksam. + +### iOS permanenten Speicherort + +Es gibt zwei gültige Speicherorte persistente Dateien auf ein iOS-Gerät speichern: das Dokumenten-Verzeichnis und das Verzeichnis Library. Frühere Versionen des Plugins gespeichert immer nur persistente Dateien im Verzeichnis Dokumente. Dies hatte den Nebeneffekt einer Anwendung Dateien in iTunes, die oft unbeabsichtigte, speziell für Anwendungen, die viele kleine Dateien behandeln war, sichtbar zu machen, anstatt komplette Dokumente für den Export, die den beabsichtigten Zweck des Verzeichnisses ist zu produzieren. + +Es ist jetzt möglich, ob Sie Dateien in Dokumente oder Verzeichnis Library mit einer Präferenz in der Anwendung-config.xml-Datei speichern möchten. Hierzu fügen Sie eine dieser zwei Zeilen zu "config.xml": + + <preference name="iosPersistentFileLocation" value="Library" /> + + <preference name="iosPersistentFileLocation" value="Compatibility" /> + + +Ohne diese Zeile wird die Datei-Erweiterung "Kompatibilität" als Standard verwenden. Wenn ein Präferenz-Tag vorhanden ist, und nicht einen der folgenden Werte, wird die Anwendung nicht gestartet. + +Wenn Ihre Anwendung für Benutzer zuvor versandt wird, mithilfe eines älteren (Pre-1.0) Version dieses Plugins und gespeicherte Dateien im permanenten Dateisystem hat, dann setzen Sie die Einstellung auf "Kompatibilität". Wechseln zu "Library" Position würde bedeuten, dass Benutzer, die ihre Anwendung aktualisieren nicht in der Lage wäre, ihre zuvor gespeicherte Dateien zugreifen. + +Wenn die Anwendung neu, oder nie zuvor Dateien im Dateisystem persistent gespeichert hat, wird die Einstellung "Bibliothek" empfohlen. + +### Firefox OS Macken + +Der Datei-System-API wird von Firefox-OS nicht nativ unterstützt und wird als ein Shim auf IndexedDB implementiert. + +* Schlägt nicht fehl, wenn Sie nicht leere Verzeichnisse entfernen +* Metadaten wird für Verzeichnisse nicht unterstützt. +* Bietet keine Unterstützung für `requestAllFileSystems` und `resolveLocalFileSystemURI` Methoden +* Methoden `copyTo` und `moveTo` unterstützen keine Verzeichnisse + +## Upgrade Notes + +In v1.0.0 des Plugins die `FileEntry` und `DirectoryEntry` Strukturen haben sich geändert, um mehr im Einklang mit der veröffentlichten Spezifikation zu sein. + +Vorgängerversionen (Pre-1.0.0) des Plugins gespeichert den Gerät-Absolute-Dateispeicherort in der `fullPath` -Eigenschaft der `Entry` Objekte. Diese Pfade würde in der Regel aussehen + + /var/mobile/Applications/<application UUID>/Documents/path/to/file (iOS) + /storage/emulated/0/path/to/file (Android) + + +Diese Pfade wurden auch zurückgegeben, indem die `toURL()` -Methode des der `Entry` Objekte. + +Mit v1.0.0 das `fullPath` -Attribut ist der Pfad zu der Datei, *relativ zum Stammverzeichnis des Dateisystems HTML*. Also die oben genannten Pfade würden jetzt beide durch dargestellt werden ein `FileEntry` -Objekt mit einer `fullPath` von + + /path/to/file + + +Wenn Ihre Anwendung mit absoluter Gerätepfade arbeitet und Sie zuvor diese Pfade durch abgerufenen die `fullPath` -Eigenschaft des `Entry` Objekte, dann Sie Ihren Code mithilfe von update sollte `entry.toURL()` statt. + +Für rückwärts Kompatibilität, die `resolveLocalFileSystemURL()` -Methode akzeptiert einen Absolute-Gerätepfad und kehren ein `Entry` -Objekt entspricht, solange diese Datei innerhalb von vorübergehenden oder dauerhaften Dateisysteme existiert. + +Dies wurde vor allem ein Problem mit dem File-Transfer-Plugin, die zuvor-Absolute-Gerätepfade verwendet (und kann damit noch einverstanden). Es wurde aktualisiert, um ordnungsgemäà mit Dateisystem-URLs, so anstelle `entry.fullPath` mit `entry.toURL()` sollte lösen Sie alle Probleme, die immer des Plugin zum Arbeiten mit Dateien auf dem Gerät. + +In v1.1.0 der Rückgabewert der `toURL()` wurde geändert (siehe \[CB-6394\] (https://issues.apache.org/jira/browse/CB-6394)), um eine absolute "file://" URL zurückgeben. wo immer möglich. Sicherstellung einer ' Cdvfile:'-URL Sie können `toInternalURL()` jetzt. Diese Methode gibt jetzt Dateisystem URLs der Form zurück. + + cdvfile://localhost/persistent/path/to/file + + +die benutzt werden können, um die Datei eindeutig zu identifizieren. + +## Liste der Fehlercodes und Bedeutungen + +Wenn ein Fehler ausgelöst wird, wird eines der folgenden Codes verwendet werden. + +* 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 + +## Konfigurieren das Plugin (Optional) + +Die Menge der verfügbaren Dateisysteme kann pro Plattform konfiguriert sein. Erkennen von iOS und Android ein <preference> -Tag im `config.xml` die Namen der Dateisysteme installiert werden. StandardmäÃig sind alle Datei-System-Roots aktiviert. + + <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" /> + + +### Android + +* Dateien: interne Datei-Speicher-Verzeichnis der Anwendung +* Dateien-extern: Verzeichnis der Anwendung externe Datei Speicher +* Sdcard: das externe Globaldatei-Speicherverzeichnis (Dies ist die Wurzel der SD-Karte, sofern installiert). Sie müssen die `android.permission.WRITE_EXTERNAL_STORAGE` Erlaubnis, diese zu verwenden. +* Cache: internen Cache-Verzeichnis der Anwendung +* Cache-extern: externer Cache-Verzeichnis der Anwendung +* Wurzel: das gesamte Gerät-Dateisystem + +Android unterstützt auch eine spezielle Dateisystem mit dem Namen "Dokumente", die ein Unterverzeichnis "/ Dokumente /" die "Dateien" Dateisystem darstellt. + +### iOS + +* Bibliothek: Bibliothek-Verzeichnis der Anwendung +* Dokumente: Dokumente-Verzeichnis der Anwendung +* Cache: Cache-Verzeichnis der Anwendung +* Bundle: die Anwendung Bündel; den Speicherort der die app selbst auf dem Datenträger (schreibgeschützt) +* Wurzel: das gesamte Gerät-Dateisystem + +StandardmäÃig können die Bibliothek und Dokumenten-Verzeichnisse mit iCloud synchronisiert werden. Sie können auch beantragen, zwei zusätzliche Dateisysteme, "Bibliothek-Nosync" und "Dokumente-Nosync", die einem speziellen nicht synchronisierten Verzeichnis im Dateisystem Bibliothek oder Dokumente darstellen. \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/4dce382c/doc/de/plugins.md ---------------------------------------------------------------------- diff --git a/doc/de/plugins.md b/doc/de/plugins.md new file mode 100644 index 0000000..1f4297f --- /dev/null +++ b/doc/de/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. +--> + +# Hinweise für Plugin-Entwickler + +Diese Notizen sollen in erster Linie für Android und iOS-Entwickler, die Plugins welche Schnittstelle mit dem Dateisystem, mit dem Datei-Plugin schreiben möchten. + +## Arbeiten mit Cordova-Datei-System-URLs + +Seit der Version 1.0.0, wurde dieses Plugin URLs mit verwendet eine `cdvfile` Regelung für die gesamte Kommunikation über die Brücke, sondern als raw-Device Dateisystempfade zu JavaScript auszusetzen. + +Auf der Seite JavaScript bedeutet dies, dass FileEntries und DirectoryEntry-Objekt ein FullPath-Attribut haben, die relativ zum Stammverzeichnis des Dateisystems HTML ist. Wenn Ihr Plugins-JavaScript-API ein FileEntries oder DirectoryEntry-Objekt akzeptiert, rufen Sie `.toURL()` auf das Objekt vor der Ãbergabe an systemeigenen Code über die Brücke. + +### Konvertieren von Cdvfile: / / URLs auf Fileystem Pfade + +Plugins, die auf das Dateisystem schreiben müssen, möchten möglicherweise eine empfangene Datei-System-URL auf eine tatsächliche Stelle des Dateisystems zu konvertieren. Es gibt mehrere Wege, dies zu tun, je nach einheitlichen Plattform. + +Es ist wichtig zu erinnern, dass nicht alle `cdvfile://` URLs sind zuweisbaren real Dateien auf das Gerät. Einige URLs verweisen auf Vermögenswerte auf Gerät die werden nicht durch Dateien dargestellt, oder sogar auf Remoteressourcen verweisen kann. Aufgrund dieser Möglichkeiten sollten Plugins immer testen, ob sie ein sinnvolles Ergebnis zu erhalten, wieder beim URLs in Pfade umwandeln. + +#### Android + +Auf Android, die einfachste Methode zum Konvertieren eines `cdvfile://` darin, dass die URL zu einem Dateisystempfad verwenden `org.apache.cordova.CordovaResourceApi` . `CordovaResourceApi`verfügt über mehrere Methoden der verarbeiten kann `cdvfile://` URLs: + + // 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)); + + +Es ist auch möglich, das Plugin Datei direkt zu verwenden: + + 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 + } + + +Konvertieren von einen Pfad zu einer `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(); + + +Wenn Ihr Plugin eine Datei erstellt, und Sie dafür ein FileEntries-Objekt zurückgeben möchten, verwenden Sie das Datei-Plugin: + + // 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 + +Cordova auf iOS verwendet nicht das gleiche `CordovaResourceApi` Konzept als Android. Auf iOS sollten Sie das Datei-Plugin verwenden, zum Konvertieren von URLs und Dateisystem-Pfaden. + + // 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]; + + +Wenn Ihr Plugin eine Datei erstellt, und Sie dafür ein FileEntries-Objekt zurückgeben möchten, verwenden Sie das Datei-Plugin: + + // 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] + + +#### JavaScript + +In JavaScript, bekommen eine `cdvfile://` URL aus einem FileEntries oder DirectoryEntry-Objekt, rufen Sie einfach `.toURL()` drauf: + + var cdvfileURL = entry.toURL(); + + +Im Plugin Antwort Handler um aus einer zurückgegebenen FileEntries-Struktur in ein tatsächliches Entry-Objekt zu konvertieren sollte Handlercode importieren die Datei-Erweiterung und ein neues Objekt erstellen: + + // 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 http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/4dce382c/doc/ja/index.md ---------------------------------------------------------------------- diff --git a/doc/ja/index.md b/doc/ja/index.md index 4351109..42ece5c 100644 --- a/doc/ja/index.md +++ b/doc/ja/index.md @@ -19,7 +19,7 @@ # 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]. +ãã®ãã©ã°ã¤ã³ã¯ã [HTML5 ãã¡ã¤ã« ã·ã¹ãã API][1]ãæä¾ãã¾ãã 使ç¨ç¶æ³ãä»¶åã« HTML5 岩 '[ãã¡ã¤ã«ã·ã¹ãã ã®è¨äº][2]ãåç §ãã¦ãã ããã ä»ã®ã¹ãã¬ã¼ã¸ ãªãã·ã§ã³ã®æ¦è¦ã«ã¤ãã¦ã¯ãã³ã«ããã®[ã¹ãã¬ã¼ã¸ ã» ã¬ã¤ã][3]ãåç §ãã¦ãã ããã. [1]: http://dev.w3.org/2009/dap/file-system/pub/FileSystem/ [2]: http://www.html5rocks.com/en/tutorials/file/filesystem/ @@ -34,55 +34,53 @@ This plugin provides the [HTML5 Filesystem API][1]. For usage, refer to HTML5 Ro * ã¢ãã¾ã³ç« OS * ã¢ã³ããã¤ã -* BlackBerry 10* +* ãã©ãã¯ããªã¼ 10 * iOS -* Windows Phone 7 and 8* -* Windows 8* +* Windows Phone 7 㨠8 * +* Windows 8 * +* Firefox ã® OS -* *These platforms do not support `FileReader.readAsArrayBuffer` nor `FileWriter.write(blob)`.* +**ãããã®ãã©ãããã©ã¼ã ããµãã¼ããã¦ããªã `FileReader.readAsArrayBuffer` ã `FileWriter.write(blob)` .* -## Configuring the Plugin +## ãã¡ã¤ã«ãä¿åããå ´æ -å©ç¨å¯è½ãªãã¡ã¤ã«ã·ã¹ãã ã®ã»ããã¯æ§æããããã©ãããã©ã¼ã ããããã¨ãã§ãã¾ããIOS 㨠Android ã®ä¸¡æ¹ãèªèãã¾ãã <preference> ã¿ã°ã® `config.xml` ãã¤ã³ã¹ãã¼ã«ãããã¡ã¤ã«ã·ã¹ãã ã®ååãã¾ããæ¢å®ã§ã¯ããã¹ã¦ã®ãã¡ã¤ã« ã·ã¹ãã ã®ã«ã¼ããæå¹ã«ãªãã¾ãã +V1.2.0ãç¾å¨éè¦ãªãã¡ã¤ã« ã·ã¹ãã ãã£ã¬ã¯ããªã¸ã® Url ãæä¾ãã¦ãã¾ãã å URL ã¯ãã©ã¼ã *file:///path/to/spot/*ã«å¤æãããã¨ãã§ãã¾ãã `DirectoryEntry` ã使ç¨ãã¦`window.resolveLocalFileSystemURL()`. - <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" /> - +`cordova.file.applicationDirectory`-èªã¿åãå°ç¨ã®ãã£ã¬ã¯ããªã¯ãã¢ããªã±ã¼ã·ã§ã³ãã¤ã³ã¹ãã¼ã«ããã¦ãã¾ããï¼*iOS*ã*ã¢ã³ããã¤ã*) -### ã¢ã³ããã¤ã +`cordova.file.applicationStorageDirectory`-ã¢ããªã®ãã©ã¤ãã¼ãã®æ¸ãè¾¼ã¿å¯è½ãªè¨æ¶åã®ã«ã¼ãã§ããï¼*iOS*ã*ã¢ã³ããã¤ã*) -* ãã¡ã¤ã«ï¼ ã¢ããªã±ã¼ã·ã§ã³ã®å é¨ãã¡ã¤ã«ã®ã¹ãã¬ã¼ã¸ ãã£ã¬ã¯ã㪠-* å¤é¨ãã¡ã¤ã«: ã¢ããªã±ã¼ã·ã§ã³ã®å¤é¨ã®ãã¡ã¤ã«ã®ã¹ãã¬ã¼ã¸ ãã£ã¬ã¯ã㪠-* 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 +`cordova.file.dataDirectory`-ã©ãã«ã¢ããªã±ã¼ã·ã§ã³åºæã®ãã¼ã¿ ãã¡ã¤ã«ãç½®ãã¾ããï¼*iOS*ã*ã¢ã³ããã¤ã*) -Android also supports a special filesystem named "documents", which represents a "/Documents/" subdirectory within the "files" filesystem. +`cordova.file.cacheDirectory`-ãã£ãã·ã¥ã®ãã¡ã¤ã«ãã¢ããªã±ã¼ã·ã§ã³ã®åèµ·åå¾ãç¶æããå¿ è¦ãããã¾ããã¢ããªã¯ãããã§ãã¡ã¤ã«ãåé¤ãã OS ä¾åããªãã§ãã ãããï¼*iOS*ã*ã¢ã³ããã¤ã*) -### iOS +`cordova.file.externalApplicationStorageDirectory`å¤é¨ã¹ãã¬ã¼ã¸ã®ã¢ããªã±ã¼ã·ã§ã³é åãï¼*iOS*ã*ã¢ã³ããã¤ã*) + +`cordova.file.externalDataDirectory`-å¤é¨ã¹ãã¬ã¼ã¸ä¸ã®ã¢ããªåºæã®ãã¼ã¿ ãã¡ã¤ã«ãé ç½®ããå ´æãï¼*ã¢ã³ããã¤ã*) + +`cordova.file.externalCacheDirectory`å¤é¨ã¹ãã¬ã¼ã¸ã«ã¢ããªã±ã¼ã·ã§ã³ ãã£ãã·ã¥ãï¼*ã¢ã³ããã¤ã*) + +`cordova.file.externalRootDirectory`-å¤é¨ã¹ãã¬ã¼ã¸ (SD ã«ã¼ã) ã«ã¼ããï¼*ã¢ã³ããã¤ã*) + +`cordova.file.tempDirectory`-OS ãã¯ãªã¢ãããã¨ãã§ãã¾ã temp ãã£ã¬ã¯ããªãã(*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 +`cordova.file.syncedDataDirectory`-ï¼ä¾ãã° iCloud) ã«åæããå¿ è¦ãããã¾ãã¢ããªã±ã¼ã·ã§ã³åºæã®ãã¡ã¤ã«ãä¿æãã¾ãã(*iOS*) -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. +`cordova.file.documentsDirectory`-ãã¡ã¤ã«ãã¢ããªããã©ã¤ãã¼ãä»è¡ãããªããªãã¾ã (Office ãã¡ã¤ã«ãªã©ï¼ ã«ã¯æå³ãã(*iOS*) ## Android ã®ç -### Android Persistent storage location +### Android ã®æ°¸ç¶çãªã¹ãã¬ã¼ã¸ã®å ´æ -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. +Android ã®ããã¤ã¹ã«æ°¸ç¶çãªãã¡ã¤ã«ãæ ¼ç´ããè¤æ°ã®æå¹ãªå ´æãããã¾ãã ãã¾ãã¾ãªå¯è½æ§ã«ã¤ãã¦åºç¯ãªè°è«ã®ããã®[ãã®ãã¼ã¸][4]ãåç §ãã¦ãã ããã [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. +以åã®ãã¼ã¸ã§ã³ã®ãã©ã°ã¤ã³ã¯ãããã¤ã¹ã® SD ã«ã¼ã ï¼ã¾ãã¯åçã®ã¹ãã¬ã¼ã¸ ãã¼ãã£ã·ã§ã³ï¼ ãã¦ã³ãããã¦ããã¨ä¸»å¼µãããã©ããã«åºã¥ãã¦ãèµ·åæã«ä¸æã¨æ°¸ç¶çãªãã¡ã¤ã«ã®å ´æãé¸ã¶ã§ãããã SD ã«ã¼ãããã¦ã³ãããã¦ããå ´åãã¾ãã¯å¤§è¦æ¨¡ãªå é¨ã¹ãã¬ã¼ã¸ ãã¼ãã£ã·ã§ã³ãå©ç¨å¯è½ãªå ´å (ãããã¯ãµã¹ ããã¤ã¹ä¸ï¼ ããæ°¸ç¶çãªãã¡ã¤ã«ã¯ããã®é åã®ã«ã¼ãã«æ ¼ç´ããã¾ãã ããã¯ãã¹ã¦ã® Cordova ã¢ããªè¦ããã¨ãã§ããå©ç¨å¯è½ãªãã¡ã¤ã«ã®ãã¹ã¦ã®ã«ã¼ãã«æå³ãã¾ããã -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. +SD ã«ã¼ããå©ç¨ã§ããªãå ´åã以åã®ãã¼ã¸ã§ã³åå¾ãã¼ã¿ãä¿å/ãã¼ã¿/ãã¼ã¿ã®ä¸<packageid>ãã¢ããªãäºãããã®åé¢ãã¾ã ã¦ã¼ã¶ã¼éã§å ±æãããã¼ã¿ãå¼ãèµ·ããå¯è½æ§ãããã¾ãã -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: +å é¨ãã¡ã¤ã«ã®ä¿åå ´æãã¢ããªã±ã¼ã·ã§ã³ã® config.xml ãã¡ã¤ã«ã«åªå é ä½ãæã¤ä»¥åã®ãã¸ãã¯ã使ç¨ãã¦ãã¡ã¤ã«ãä¿åãããã©ããã鏿ãããã¨ãå¯è½ã§ãä»ã ãããè¡ãã«ãconfig.xml ã«æ¬¡ã® 2 è¡ã®ããããã追å ãã¾ãã <preference name="AndroidPersistentFileLocation" value="Internal" /> @@ -95,18 +93,6 @@ It is now possible to choose whether to store files in the internal file storage ã¢ããªã±ã¼ã·ã§ã³å ´åã¯ãæ°ãããã¾ãã¯æ°¸ç¶çãªãã¡ã¤ã«ã·ã¹ãã ã«ãã¡ã¤ã«ãæ ¼ç´ãã以åã¯æ±ºãã¦ããå é¨ãã®è¨å®ã¯æ¨å¥¨ä¸è¬ã«ã -## ãã©ãã¯ããªã¼ã®ç - -`DirectoryEntry.removeRecursively()`失æããå¯è½æ§ãããã¾ãã `ControlledAccessException` ãæ¬¡ã®å ´åã - -* ã¢ããªã¯ãã¢ããªã®ä»¥åã®ã¤ã³ã¹ãã¼ã«ã«ãã£ã¦ä½æããããã£ã¬ã¯ããªã«ã¢ã¯ã»ã¹ãããã¨ãã¾ãã - -> 解決ç: æåã§ãã¾ãã¯åã¤ã³ã¹ãã¼ã«ããåã«ã¢ããªã±ã¼ã·ã§ã³ã«ãã£ã¦ä¸æãã£ã¬ã¯ããªã¯ãããã«ç¢ºèªãã¦ãã ããã - -* å ´åã¯ãããã¤ã¹ã¯ USB ã§æ¥ç¶ããã¾ããã - -> ã½ãªã¥ã¼ã·ã§ã³: åå®è¡ãã¦ãããã¤ã¹ãã USB ã±ã¼ãã«ãå¤ãã¾ãã - ## iOS ã®ç * `FileReader.readAsText(blob, encoding)` @@ -129,6 +115,15 @@ IOS ããã¤ã¹ã«æ°¸ç¶çãªãã¡ã¤ã«ãæ ¼ç´ãã 2 ã¤ã®æå¹ãªå ´ ã¢ããªã±ã¼ã·ã§ã³å ´åã¯ãæ°ãããã¾ãã¯æ°¸ç¶çãªãã¡ã¤ã«ã·ã¹ãã ã«ãã¡ã¤ã«ãæ ¼ç´ãã以åã¯æ±ºãã¦ããã©ã¤ãã©ãªãè¨å®ã¯æ¨å¥¨ä¸è¬ã«ã +### Firefox OS ç + +ãã¡ã¤ã« ã·ã¹ãã API Firefox OS ã§ãã¤ãã£ã ãµãã¼ãããã¦ããªãã¨ãindexedDB ã®ä¸ã«ã·ã ã¨ãã¦å®è£ ããã¦ãã¾ãã + +* 空ã§ãªããã£ã¬ã¯ããªãåé¤ããã¨ãã«å¤±æãã¾ãã +* ãã£ã¬ã¯ããªã®ã¡ã¿ãã¼ã¿ããµãã¼ããã¦ãã¾ãã +* ãµãã¼ããã¦ããªã `requestAllFileSystems` 㨠`resolveLocalFileSystemURI` æ¹æ³ +* æ¹æ³ `copyTo` 㨠`moveTo` ãã£ã¬ã¯ããªããµãã¼ããã¦ãã¾ãã + ## ãã¼ããã¢ããã°ã¬ã¼ããã¾ãã ãã®ãã©ã°ã¤ã³ã®ãããããã¼ã§ã `FileEntry` 㨠`DirectoryEntry` æ§é 夿´ãå ¬éããã仿§ã«æ²¿ã£ãããå¤ãã§ããã¾ãã @@ -146,16 +141,18 @@ IOS ããã¤ã¹ã«æ°¸ç¶çãªãã¡ã¤ã«ãæ ¼ç´ãã 2 ã¤ã®æå¹ãªå ´ /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 ãè¿ãã¾ãä» +å ´åã¯ãã¢ããªã±ã¼ã·ã§ã³ã¯ããã¤ã¹çµ¶å¯¾ãã¹ã§åä½ãã以åãããããã®ãã¹ãåå¾ã `fullPath` ã®ãããã㣠`Entry` ã使ç¨ãã¦ã³ã¼ããæ´æ°ããå¿ è¦ãããããªãã¸ã§ã¯ã `entry.toURL()` 代ããã«ã - cdvfile://localhost/persistent/path/to/file - +徿¹ã®äºææ§ã `resolveLocalFileSystemURL()` ã¡ã½ããã¯ããã¤ã¹çµ¶å¯¾ãã¹ãåãå ¥ããããæ»ãã¾ãã `Entry` ã䏿çã¾ãã¯æ°¸ç¶çãªãã¡ã¤ã« ã» ã·ã¹ãã å ã§ãã®ãã¡ã¤ã«ãåå¨ããéããããã«å¯¾å¿ãããªãã¸ã§ã¯ãã -which can be used to identify the file uniquely. +ããã¯ç¹ã«ä»¥åããã¤ã¹çµ¶å¯¾ãã¹ã使ç¨ãã¦ãã¡ã¤ã«è»¢éã®ãã©ã°ã¤ã³ã§åé¡ã¨ãªã£ã¦ãã ï¼ããã¦ã¾ã ããããåãå ¥ãããã¨ãã§ãã¾ãï¼ã ã®ã§äº¤æããã¡ã¤ã«ã·ã¹ãã ã® Url ã§æ£ããåä½ããããã«æ´æ°ããã¦ãã `entry.fullPath` 㨠`entry.toURL()` ããã¤ã¹ä¸ã®ãã¡ã¤ã«ã§åä½ãããã©ã°ã¤ã³ãå¾ã¦åé¡ã解決ããå¿ è¦ãããã¾ãã -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. +V1.1.0 æ»ãå¤ã§ã® `toURL()` ã夿´ããã (\[CB-6394\] (https://issues.apache.org/jira/browse/CB-6394) ãåç §) ã絶対ç㪠'file://' ã§å§ã¾ã URL ãè¿ãã¾ãã å¯è½ãªéãã 確ä¿ããããã«ã' cdvfile:'-使ç¨ãããã¨ãã§ãã¾ã URL `toInternalURL()` ä»ã ãã®ã¡ã½ããã¯ããã©ã¼ã ã®ãã¡ã¤ã«ã·ã¹ãã ã® Url ãè¿ãã¾ãä» -ããã¯ç¹ã«ä»¥åããã¤ã¹çµ¶å¯¾ãã¹ã使ç¨ãã¦ãã¡ã¤ã«è»¢éã®ãã©ã°ã¤ã³ã§åé¡ã¨ãªã£ã¦ãã ï¼ããã¦ã¾ã ããããåãå ¥ãããã¨ãã§ãã¾ãï¼ã ã®ã§äº¤æããã¡ã¤ã«ã·ã¹ãã ã® Url ã§æ£ããåä½ããããã«æ´æ°ããã¦ãã `entry.fullPath` 㨠`entry.toURL()` ããã¤ã¹ä¸ã®ãã¡ã¤ã«ã§åä½ãããã©ã°ã¤ã³ãå¾ã¦åé¡ã解決ããå¿ è¦ãããã¾ãã + cdvfile://localhost/persistent/path/to/file + + +ããã¯ãã¡ã¤ã«ã䏿ã«èå¥ããããã«ä½¿ç¨ã§ãã¾ãã ## ã¨ã©ã¼ ã³ã¼ãã¨æå³ã®ãªã¹ã @@ -172,4 +169,33 @@ For backwards compatibility, the `resolveLocalFileSystemURL()` method will accep * 9 = INVALID\_MODIFICATION\_ERR * 10 = QUOTA\_EXCEEDED\_ERR * 11 = TYPE\_MISMATCH\_ERR -* 12 = PATH\_EXISTS\_ERR \ No newline at end of file +* 12 = PATH\_EXISTS\_ERR + +## (çç¥å¯è½) ãã©ã°ã¤ã³ãæ§æãã¾ãã + +å©ç¨å¯è½ãªãã¡ã¤ã«ã·ã¹ãã ã®ã»ããã¯æ§æããããã©ãããã©ã¼ã ããããã¨ãã§ãã¾ãã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" /> + + +### ã¢ã³ããã¤ã + +* ãã¡ã¤ã«ï¼ ã¢ããªã±ã¼ã·ã§ã³ã®å é¨ãã¡ã¤ã«ã®ã¹ãã¬ã¼ã¸ ãã£ã¬ã¯ã㪠+* å¤é¨ãã¡ã¤ã«: ã¢ããªã±ã¼ã·ã§ã³ã®å¤é¨ã®ãã¡ã¤ã«ã®ã¹ãã¬ã¼ã¸ ãã£ã¬ã¯ã㪠+* sd ã«ã¼ãï¼ãã°ãã¼ãã«å¤é¨ã¹ãã¬ã¼ã¸ ãã£ã¬ã¯ããªããã¡ã¤ã« (ãã㯠SD ã«ã¼ãã®ã«ã¼ããã¤ã³ã¹ãã¼ã«ããã¦ããå ´å)ã å¿ è¦ãããã¾ãã `android.permission.WRITE_EXTERNAL_STORAGE` ããã使ç¨ããã¢ã¯ã»ã¹è¨±å¯ã +* ãã£ãã·ã¥ï¼ ã¢ããªã±ã¼ã·ã§ã³ã®å é¨ãã£ãã·ã¥ ãã£ã¬ã¯ã㪠+* ãã£ãã·ã¥å¤é¨ï¼ å¤é¨ãã£ãã·ã¥ã®ã¢ããªã±ã¼ã·ã§ã³ã®ãã£ã¬ã¯ã㪠+* ã«ã¼ãï¼ ããã¤ã¹å ¨ä½ã®ãã¡ã¤ã«ã·ã¹ãã + +ã¢ã³ããã¤ããããã¡ã¤ã«ããã¡ã¤ã«ã·ã¹ãã å ã®"ããã¥ã¡ã³ã/"ãµããã£ã¬ã¯ããªã表ã"ããã¥ã¡ã³ã"ã¨ããååã®ç¹æ®ãªãã¡ã¤ã«ã·ã¹ãã ããµãã¼ããã¦ãã¾ãã + +### iOS + +* ã©ã¤ãã©ãª: ã©ã¤ãã©ãªã®ã¢ããªã±ã¼ã·ã§ã³ã®ãã£ã¬ã¯ã㪠+* ããã¥ã¡ã³ã: ããã¥ã¡ã³ãã®ã¢ããªã±ã¼ã·ã§ã³ã®ãã£ã¬ã¯ã㪠+* ãã£ãã·ã¥: ãã£ãã·ã¥ã®ã¢ããªã±ã¼ã·ã§ã³ã®ãã£ã¬ã¯ã㪠+* ãã³ãã«: ã¢ããªã±ã¼ã·ã§ã³ãã³ãã«;ã¢ããªèªä½ (èªã¿åãã®ã¿) ãã£ã¹ã¯ä¸ã®å ´æ +* ã«ã¼ãï¼ ããã¤ã¹å ¨ä½ã®ãã¡ã¤ã«ã·ã¹ãã + +æ¢å®ã§ã¯ãã©ã¤ãã©ãªã¨ããã¥ã¡ã³ã ãã£ã¬ã¯ããªã iCloud ã«åæã§ãã¾ãã ã©ã¤ãã©ãªã¾ãã¯ããã¥ã¡ã³ãã®ãã¡ã¤ã«ã·ã¹ãã å ã®ç¹å¥ãªéåæãã£ã¬ã¯ããªã表ã 2 ã¤ã®è¿½å ã®ãã¡ã¤ã«ã·ã¹ãã ã"ã©ã¤ãã©ãª nosync"ããããã¥ã¡ã³ã nosyncããè¦æ±ãããã¨ãã§ãã¾ãã \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/4dce382c/doc/ja/plugins.md ---------------------------------------------------------------------- diff --git a/doc/ja/plugins.md b/doc/ja/plugins.md index 1a0efa1..3dedb28 100644 --- a/doc/ja/plugins.md +++ b/doc/ja/plugins.md @@ -17,7 +17,7 @@ under the License. --> -# Notes for plugin developers +# ãã©ã°ã¤ã³éçºè ã®ããã®ãã¼ã ãããã®ãã¼ãã¯ã主ã«äººé 人é㨠iOS éçºè åããã¡ã¤ã«ã®ãã©ã°ã¤ã³ã使ç¨ãã¦ããã¡ã¤ã« ã·ã¹ãã ã§ãã©ã°ã¤ã³ã®ã¤ã³ã¿ã¼ãã§ã¤ã¹ãè¨è¿°ãããã®ã
