You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by mw...@apache.org on 2013/09/10 19:36:53 UTC
[08/51] [abbrv] [partial] Move Japanese to docs/ja and Korean to
docs/ko.
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/e7168dd7/docs/ja/2.2.0/cordova/file/fileentry/fileentry.md
----------------------------------------------------------------------
diff --git a/docs/ja/2.2.0/cordova/file/fileentry/fileentry.md b/docs/ja/2.2.0/cordova/file/fileentry/fileentry.md
new file mode 100644
index 0000000..301800e
--- /dev/null
+++ b/docs/ja/2.2.0/cordova/file/fileentry/fileentry.md
@@ -0,0 +1,326 @@
+---
+license: 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.
+---
+
+FileEntry
+==========
+
+このオブジェクトはファイルシステムのファイルを表します。これは [W3C Directories and Systems](http://www.w3.org/TR/file-system-api/) の仕様書で定義されています。
+
+プロパティー
+----------
+
+- __isFile:__ 常に true を表します _(boolean)_
+- __isDirectory:__ 常に false を表します _(boolean)_
+- __name:__ パスを除いた FileEntry の名前を表します _(DOMString)_
+- __fullPath:__ ルートから FileEntry への絶対パスを表します _(DOMString)_
+
+注意: 以下の属性は W3C の仕様書によって定義されていますが、 Cordova では __サポートされていません__ :
+
+- __filesystem:__ FileEntry が属するファイルシステムを表します _(FileSystem)_
+
+
+メソッド
+-------
+
+- __getMetadata__: ファイルのメタデータを取得します
+- __setMetadata__: ディレクトリのメタデータをセットします
+- __moveTo__: ファイルを、ファイルシステム内の別の場所に移動します
+- __copyTo__: ファイルを、ファイルシステム内の別の場所にコピーします
+- __toURL__: ファイルの位置特定に使用できる URL を返します
+- __remove__: ファイルを削除します
+- __getParent__: 親ディレクトリを取得します
+- __createWriter__: ファイルの書き込みに使用できる FileWriter オブジェクトを作成します
+- __file__: ファイルプロパティーを含む File オブジェクトを作成します
+
+
+サポートされているプラットフォーム
+-------------------
+
+- Android
+- BlackBerry WebWorks (OS 5.0 以上)
+- iOS
+- Windows Phone 7 (Mango)
+
+
+getMetadata
+----------------
+
+ファイルのメタデータを取得します。
+
+__パラメーター:__
+
+- __successCallback__ - Metadata オブジェクトを伴って呼び出されるコールバック関数を表します _(Function)_
+- __errorCallback__ - Metadata の取得時にエラーが起きた場合に呼び出されるコールバック関数を表します。 FileError オブジェクトを伴って呼び出されます _(Function)_
+
+
+__使用例__
+
+ function success(metadata) {
+ console.log("最終更新日: " + metadata.modificationTime);
+ }
+
+ function fail(error) {
+ alert(error.code);
+ }
+
+ // このエントリーの Metadata オブジェクトを取得
+ entry.getMetadata(success, fail);
+
+
+setMetadata
+----------------
+
+ディレクトリのメタデータをセットします。
+**現在 iOS のみ対応しています** - ディレクトリの拡張属性をセットします。
+
+__パラメーター:__
+
+- __successCallback__ - Metadata が正常にセットされたときに呼び出されるコールバック関数を表します _(Function)_
+- __errorCallback__ - Metadata のセット時にエラーが起きた場合に呼び出されるコールバック関数を表します _(Function)_
+- __metadataObject__ - Metadata のキーと値が格納されているオブジェクトを表します _(Object)_
+
+
+__使用例__
+
+ function success() {
+ console.log("メタデータが正常にセットされました。");
+ }
+
+ function fail() {
+ alert("メタデータ作成中にエラーが発生しました。");
+ }
+
+ // メタデータをセット
+ entry.setMetadata(success, fail, { "com.apple.MobileBackup": 1});
+__iOS に関する注意点__
+
+- **"com.apple.MobileBackup"** 拡張属性のみサポートされています。値を **1** とセットすることで、ディレクトリを iCloud でバックアップされない設定とします。値を **0** とセットすることで、再度ディレクトリを iCloud でバックアップされる設定とします。
+
+__使用例__
+
+ function setFileMetadata(localFileSystem, filePath, metadataKey, metadataValue)
+ {
+ var onSetMetadataWin = function() {
+ console.log("メタデータが正常にセットされました。")
+ }
+ var onSetMetadataFail = function() {
+ console.log("メタデータ作成中にエラーが発生しました。")
+ }
+
+ var onGetFileWin = function(parent) {
+ var data = {};
+ data[metadataKey] = metadataValue;
+ parent.setMetadata(onSetMetadataWin, onSetMetadataFail, data);
+ }
+ var onGetFileFail = function() {
+ console.log("ファイル取得中にエラーが発生しました。")
+ }
+
+ var onFSWin = function(fileSystem) {
+ fileSystem.root.getFile(filePath, {create: true, exclusive: false}, onGetFileWin, onGetFileFail);
+ }
+
+ var onFSFail = function(evt) {
+ console.log(evt.target.error.code);
+ }
+
+ window.requestFileSystem(localFileSystem, 0, onFSWin, onFSFail);
+ }
+
+ setFileMetadata(LocalFileSystem.PERSISTENT, "Backups/sqlite.db", "com.apple.MobileBackup", 1);
+
+moveTo
+------
+
+ファイルを、ファイルシステム内の別の場所に移動します。 以下のことを試みるとエラーが発生します:
+
+- もし移動先親ディレクトリが移動元と同じで、移動先ファイル名も移動元と同じである場合
+- もし移動先のファイル名がディレクトリである場合
+
+ファイルをすでに存在するファイルの場所に移動する行為は、削除してファイルを置き換える行為となります。
+
+__パラメーター:__
+
+- __parent__ - ファイルの移動先の親ディレクトリを表します _(DirectoryEntry)_
+- __newName__ - ファイルの新しい名前を表します。もし指定されていない場合は、デフォルトで現在の名前となります _(DOMString)_
+- __successCallback__ - 新しいファイルの FileEntry を伴って呼び出されるコールバック関数を表します _(Function)_
+- __errorCallback__ - ファイルの移動中にエラーが起きた場合に呼び出されるコールバック関数を表します。 FileError オブジェクトを伴って呼び出されます _(Function)_
+
+
+__使用例__
+
+ function success(entry) {
+ console.log("新しいパス: " + entry.fullPath);
+ }
+
+ function fail(error) {
+ alert(error.code);
+ }
+
+ function moveFile(entry) {
+ var parent = document.getElementById('parent').value,
+ parentName = parent.substring(parent.lastIndexOf('/')+1),
+ parentEntry = new DirectoryEntry(parentName, parent);
+
+ // ファイルを新しいディレクトリに移動し、名前付け替えます
+ entry.moveTo(parentEntry, "newFile.txt", success, fail);
+ }
+
+
+copyTo
+------
+
+ファイルを、ファイルシステム内の別の場所にコピーします。以下のことを試みるとエラーが発生します:
+
+- もしコピー先親ディレクトリがコピー元と同じで、コピー先ファイル名もコピー元と同じである場合
+
+__パラメーター:__
+
+- __parent__ - ファイルのコピー先の親ディレクトリを表します _(DirectoryEntry)_
+- __newName__ - ファイルの新しい名前を表します。もし指定されていない場合は、デフォルトで現在の名前となります _(DOMString)_
+- __successCallback__ - 新しいファイルの FileEntry を伴って呼び出されるコールバック関数を表します _(Function)_
+- __errorCallback__ - ファイルのコピー中にエラーが起きた場合に呼び出されるコールバック関数を表します。 FileError オブジェクトを伴って呼び出されます _(Function)_
+
+
+__使用例__
+
+ function win(entry) {
+ console.log("新しいパス: " + entry.fullPath);
+ }
+
+ function fail(error) {
+ alert(error.code);
+ }
+
+ function copyFile(entry) {
+ var parent = document.getElementById('parent').value,
+ parentName = parent.substring(parent.lastIndexOf('/')+1),
+ parentEntry = new DirectoryEntry(parentName, parent);
+
+ // ファイルを新しいディレクトリにコピーし、名前付け替えます
+ entry.copyTo(parentEntry, "file.copy", success, fail);
+ }
+
+
+toURL
+-----
+
+ファイルの位置特定に使用できる URL を返します。
+
+__使用例__
+
+ // このエントリーの URL を取得
+ var fileURL = entry.toURL();
+ console.log(fileURL);
+
+
+remove
+------
+
+ファイルを削除します。
+
+__パラメーター:__
+
+- __successCallback__ - ファイルが削除されたときに呼び出されるコールバック関数を表します。 パラメーターなしで呼び出されます _(Function)_
+- __errorCallback__ - ファイルの削除中にエラーが起きた場合に呼び出されるコールバック関数を表します。 FileError オブジェクトを伴って呼び出されます _(Function)_
+
+__使用例__
+
+ function success(entry) {
+ console.log("削除成功");
+ }
+
+ function fail(error) {
+ alert('ファイルの削除に失敗しました: ' + error.code);
+ }
+
+ // ファイルの削除
+ entry.remove(success, fail);
+
+
+getParent
+---------
+
+そのファイルの親 DirectoryEntry を取得します。
+
+__パラメーター:__
+
+- __successCallback__ - ファイルの親 DirectoryEntry を伴って呼び出されるコールバック関数を表します _(Function)_
+- __errorCallback__ - ファイルの親 DirectoryEntry の取得中にエラーが起きた場合に呼び出されるコールバック関数を表します。 FileError オブジェクトを伴って呼び出されます _(Function)_
+
+__使用例__
+
+ function success(parent) {
+ console.log("親ディレクトリの名前: " + parent.name);
+ }
+
+ function fail(error) {
+ alert(error.code);
+ }
+
+ // 親 DirectoryEntry を取得
+ entry.getParent(success, fail);
+
+
+createWriter
+------------
+
+FileEntry の表すファイルに使われる FileWriter オブジェクトを作成します。
+
+__パラメーター:__
+
+- __successCallback__ - FileWriter オブジェクトを伴って呼び出されるコールバック関数を表します _(Function)_
+- __errorCallback__ - FileWriter の作成中にエラーが起きた場合に呼び出されるコールバック関数を表します。 FileError オブジェクトを伴って呼び出されます _(Function)_
+
+__使用例__
+
+ function success(writer) {
+ writer.write("ファイルに書き込むテキスト");
+ }
+
+ function fail(error) {
+ alert(error.code);
+ }
+
+ // ファイルへの書き込みのための FileWriter を作成
+ entry.createWriter(success, fail);
+
+
+file
+----
+
+FileEntry の表すファイルの現在の状態を表す File オブジェクトを返します。
+
+__パラメーター:__
+
+- __successCallback__ - File オブジェクトを伴って呼び出されるコールバック関数を表します _(Function)_
+- __errorCallback__ - Fileオブジェクト作成中にエラーが起きた場合に呼び出されるコールバック関数を表します (例: 元のファイルが既に存在しない場合) 。 FileError オブジェクトを伴って呼び出されます _(Function)_
+
+__使用例__
+
+ function success(file) {
+ console.log("File サイズ: " + file.size);
+ }
+
+ function fail(error) {
+ alert("ファイルのプロパティーを取得できませんでした: " + error.code);
+ }
+
+ // ファイルのプロパティーを取得
+ entry.file(success, fail);
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/e7168dd7/docs/ja/2.2.0/cordova/file/fileerror/fileerror.md
----------------------------------------------------------------------
diff --git a/docs/ja/2.2.0/cordova/file/fileerror/fileerror.md b/docs/ja/2.2.0/cordova/file/fileerror/fileerror.md
new file mode 100644
index 0000000..0fb5da0
--- /dev/null
+++ b/docs/ja/2.2.0/cordova/file/fileerror/fileerror.md
@@ -0,0 +1,49 @@
+---
+license: 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.
+---
+
+FileError
+========
+
+`FileError` オブジェクトはエラーが発生した際に File API のメソッドに渡されます。
+
+プロパティー
+----------
+
+- __code:__ 事前に定義された以下のエラーコードのうちの1つを表します
+
+定数
+---------
+
+- `FileError.NOT_FOUND_ERR`
+- `FileError.SECURITY_ERR`
+- `FileError.ABORT_ERR`
+- `FileError.NOT_READABLE_ERR`
+- `FileError.ENCODING_ERR`
+- `FileError.NO_MODIFICATION_ALLOWED_ERR`
+- `FileError.INVALID_STATE_ERR`
+- `FileError.SYNTAX_ERR`
+- `FileError.INVALID_MODIFICATION_ERR`
+- `FileError.QUOTA_EXCEEDED_ERR`
+- `FileError.TYPE_MISMATCH_ERR`
+- `FileError.PATH_EXISTS_ERR`
+
+概要
+-----------
+
+`FileError` オブジェクトは File API のあらゆるエラーコールバック関数への唯一のパラメーターです。開発者はエラーのタイプを特定するために、 code プロパティーを確認する必要があります。
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/e7168dd7/docs/ja/2.2.0/cordova/file/fileobj/fileobj.md
----------------------------------------------------------------------
diff --git a/docs/ja/2.2.0/cordova/file/fileobj/fileobj.md b/docs/ja/2.2.0/cordova/file/fileobj/fileobj.md
new file mode 100644
index 0000000..be7ba4d
--- /dev/null
+++ b/docs/ja/2.2.0/cordova/file/fileobj/fileobj.md
@@ -0,0 +1,45 @@
+---
+license: 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.
+---
+
+File
+====
+
+このオブジェクトは一つのファイルの属性を含みます。
+
+プロパティー
+----------
+
+- __name:__ ファイルの名前を表します。 _(DOMString)_
+- __fullPath:__ ファイルの名前を含むフルパスを表します。 _(DOMString)_
+- __type:__ ファイルの mime type を表します。 _(DOMString)_
+- __lastModifiedDate:__ ファイルの最終更新日時を表します。 _(Date)_
+- __size:__ ファイルのサイズをバイトで表します。 _(long)_
+
+詳細
+-------
+
+この `File` オブジェクトは一つのファイルの属性を含みます。 `FileEntry` オブジェクトの __file__ メソッドを呼び出すことで、 File オブジェクトのインスタンスを取得できます。
+
+サポートされているプラットフォーム
+-------------------
+
+- Android
+- BlackBerry WebWorks (OS 5.0 以上)
+- iOS
+- Windows Phone 7 (Mango)
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/e7168dd7/docs/ja/2.2.0/cordova/file/filereader/filereader.md
----------------------------------------------------------------------
diff --git a/docs/ja/2.2.0/cordova/file/filereader/filereader.md b/docs/ja/2.2.0/cordova/file/filereader/filereader.md
new file mode 100644
index 0000000..38c376b
--- /dev/null
+++ b/docs/ja/2.2.0/cordova/file/filereader/filereader.md
@@ -0,0 +1,196 @@
+---
+license: 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.
+---
+
+FileReader
+==========
+
+FileReader はファイルの読み込みを行うオブジェクトです。
+
+プロパティー
+----------
+
+- __readyState:__ 右の3種類の状態のいずれかを表します (EMPTY, LOADING, DONE)
+- __result:__ 読み込まれたファイルのコンテンツを表します _(DOMString)_
+- __error:__ エラー情報を表します _(FileError)_
+- __onloadstart:__ 読み込み開始時に呼ばれる関数を表します _(Function)_
+- __onprogress:__ 読込中に呼ばれ、進捗状況を報告する関数を表します (progess.loaded/progress.total) _(Function)_ - 現在サポートされていません
+- __onload:__ 読み込みが成功したときに呼ばれる関数を表します _(Function)_
+- __onabort:__ abort() メソッドを実行したときなど、 読み込みが強制終了したときに呼ばれる関数を表します _(Function)_
+- __onerror:__ 読み込みが失敗したときに呼ばれる関数を表します _(Function)_
+- __onloadend:__ 成功、失敗にかかわらずリクエストが完了した際に呼ばれる関数を表します _(Function)_
+
+メソッド
+-------
+
+- __abort__: 読み込みを強制終了します
+- __readAsDataURL__: ファイルを読み込み、データを Base64 エンコードされたデータ URL で返します
+- __readAsText__: テキストファイルを読み込みます
+
+詳細
+-------
+
+`FileReader` オブジェクトはデバイスのファイルシステムからファイルを読み込む際に使用します。ファイルはテキストもしくは Base64 でエンコードされた文字列として読み込まれます。また、 loadstart, progress, load, loadend, error や abort などのイベントを受け取るための独自のイベントリスナーを登録することも出来ます。
+
+サポートされているプラットフォーム
+-------------------
+
+- Android
+- BlackBerry WebWorks (OS 5.0 以上)
+- iOS
+- Windows Phone 7 (Mango)
+
+データ URL として読み込む場合
+----------------
+
+__パラメーター:__
+- file - 読み込むファイルのフルパスを表します
+
+
+使用例
+-------------
+
+ function win(file) {
+ var reader = new FileReader();
+ reader.onloadend = function(evt) {
+ console.log("読み込み成功");
+ console.log(evt.target.result);
+ };
+ reader.readAsDataURL(file);
+ };
+
+ var fail = function(error) {
+ console.log(error.code);
+ };
+
+ entry.file(win, fail);
+
+テキストとして読み込む場合
+------------
+
+__パラメーター:__
+
+- file - 読み込むファイルのフルパスを表します
+- encoding - ファイルのコンテンツのエンコードを表します (デフォルト: UTF-8)
+
+使用例
+-------------
+
+ function win(file) {
+ var reader = new FileReader();
+ reader.onloadend = function(evt) {
+ console.log("読み込み成功");
+ console.log(evt.target.result);
+ };
+ reader.readAsText(file);
+ };
+
+ var fail = function(error) {
+ console.log(error.code);
+ };
+
+ entry.file(win, fail);
+
+Abort の例
+-------------------
+
+ function win(file) {
+ var reader = new FileReader();
+ reader.onloadend = function(evt) {
+ console.log("読み込み成功");
+ console.log(evt.target.result);
+ };
+ reader.readAsText(file);
+ reader.abort();
+ };
+
+ function fail(error) {
+ console.log(error.code);
+ }
+
+ entry.file(win, fail);
+
+詳細な使用例
+------------
+
+ <!DOCTYPE html>
+ <html>
+ <head>
+ <title>FileReader の使用例</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova-2.2.0.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Cordova の読み込み完了まで待機
+ //
+ function onLoad() {
+ document.addEventListener("deviceready", onDeviceReady, false);
+ }
+
+ // Cordova 準備完了
+ //
+ function onDeviceReady() {
+ window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFS, fail);
+ }
+
+ function gotFS(fileSystem) {
+ fileSystem.root.getFile("readme.txt", null, gotFileEntry, fail);
+ }
+
+ function gotFileEntry(fileEntry) {
+ fileEntry.file(gotFile, fail);
+ }
+
+ function gotFile(file){
+ readDataUrl(file);
+ readAsText(file);
+ }
+
+ function readDataUrl(file) {
+ var reader = new FileReader();
+ reader.onloadend = function(evt) {
+ console.log("データ URL として読み込み");
+ console.log(evt.target.result);
+ };
+ reader.readAsDataURL(file);
+ }
+
+ function readAsText(file) {
+ var reader = new FileReader();
+ reader.onloadend = function(evt) {
+ console.log("テキストとして読み込み");
+ console.log(evt.target.result);
+ };
+ reader.readAsText(file);
+ }
+
+ function fail(error) {
+ console.log(error.code);
+ }
+
+ </script>
+ </head>
+ <body>
+ <h1>使用例</h1>
+ <p>ファイルを読み込みます。</p>
+ </body>
+ </html>
+
+iOS に関する注意点
+----------
+- __encoding__ パラメーターはサポートされておらず、常に UTF-8 エンコーディングが使われます。
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/e7168dd7/docs/ja/2.2.0/cordova/file/filesystem/filesystem.md
----------------------------------------------------------------------
diff --git a/docs/ja/2.2.0/cordova/file/filesystem/filesystem.md b/docs/ja/2.2.0/cordova/file/filesystem/filesystem.md
new file mode 100644
index 0000000..833f35a
--- /dev/null
+++ b/docs/ja/2.2.0/cordova/file/filesystem/filesystem.md
@@ -0,0 +1,91 @@
+---
+license: 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.
+---
+
+FileSystem
+==========
+
+このオブジェクトはファイルシステムを表します。
+
+プロパティー
+----------
+
+- __name:__ ファイルシステムの名前を表します _(DOMString)_
+- __root:__ ファイルシステムのルートディレクトリを表します _(DirectoryEntry)_
+
+詳細
+-------
+
+`FileSystem` オブジェクトはファイルシステムの情報を表します。ファイルシステムの名前は既にあるファイルシステムに対して一意になります。 root プロパティーはファイルシステムのルートディレクトリを表す `DirectoryEntry` オブジェクトを保持します。
+
+サポートされているプラットフォーム
+-------------------
+
+- Android
+- BlackBerry WebWorks (OS 5.0 以上)
+- iOS
+- Windows Phone 7 (Mango)
+
+File System の使用例
+-------------------------
+
+ function onSuccess(fileSystem) {
+ console.log(fileSystem.name);
+ console.log(fileSystem.root.name);
+ }
+
+ // ファイルシステムをリクエスト
+ window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onSuccess, null);
+
+詳細な使用例
+------------
+
+ <!DOCTYPE html>
+ <html>
+ <head>
+ <title>File System の使用例</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova-2.2.0.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Cordova の読み込み完了まで待機
+ //
+ document.addEventListener("deviceready", onDeviceReady, false);
+
+ // Cordova 準備完了
+ //
+ function onDeviceReady() {
+ window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onFileSystemSuccess, fail);
+ }
+
+ function onFileSystemSuccess(fileSystem) {
+ console.log(fileSystem.name);
+ console.log(fileSystem.root.name);
+ }
+
+ function fail(error) {
+ console.log(error.code);
+ }
+
+ </script>
+ </head>
+ <body>
+ <h1>Example</h1>
+ <p>File System</p>
+ </body>
+ </html>
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/e7168dd7/docs/ja/2.2.0/cordova/file/filetransfer/filetransfer.md
----------------------------------------------------------------------
diff --git a/docs/ja/2.2.0/cordova/file/filetransfer/filetransfer.md b/docs/ja/2.2.0/cordova/file/filetransfer/filetransfer.md
new file mode 100644
index 0000000..a0c8d48
--- /dev/null
+++ b/docs/ja/2.2.0/cordova/file/filetransfer/filetransfer.md
@@ -0,0 +1,253 @@
+---
+license: 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.
+---
+
+FileTransfer
+==========
+
+FileTransfer オブジェクトはファイルをサーバーにアップロードまたはサーバからダウンロードする際に使用します。
+
+プロパティー
+----------
+
+- __onprogress:__ ProgressEvent とともに、新しいデーターの塊が転送される度に呼び出される関数を表します _(Function)_
+
+メソッド
+-------
+
+- __upload__: サーバーにファイルを送信します
+- __download__: サーバーからファイルをダウンロードします
+- __abort__: 進行中の転送を中止します
+
+詳細
+-------
+
+`FileTransfer` オブジェクトは HTTP マルチパート POST リクエストを使ってファイルをサーバーにアップロードする機能を提供します。このメソッドは HTTP と HTTPS の両方のプロトコルをサポートします。 upload メソッドに FileUploadOptions オブジェクトを渡すことで、任意のパラメーターを追加できます。アップロードが成功した場合 FileUploadResult オブジェクトとともに success コールバック関数が呼ばれます。エラーが発生した場合は FileTransferError オブジェクトとともに error コールバック関数が呼ばれます。
+また、サーバーからファイルをダウンロードし保存することもできます (iOS と Android のみ) 。
+
+サポートされているプラットフォーム
+-------------------
+
+- Android
+- BlackBerry WebWorks (OS 5.0 以上)
+- iOS
+- Windows Phone 7 (Mango)
+
+upload
+--------------
+
+__パラメーター:__
+
+- __filePath__ - デバイス内のファイルのフルパスを表します
+- __server__ - ファイルを受け取るサーバーの URL を表します (encodeURI() を使用して既にエンコードされている必要があります)
+- __successCallback__ - Metadata オブジェクトを伴って呼び出されるコールバック関数を表します _(Function)_
+- __errorCallback__ - Metadata の取得時にエラーが起きた場合に呼び出されるコールバック関数を表します。 FileError オブジェクトを伴って呼び出されます _(Function)_
+- __options__ - ファイル名や minetype などのオプションのパラメーターを表します
+
+__使用例__
+
+ // !! fileURI の値は有効なデバイス内の有効なテキストファイルの URI であるとみなします
+
+ var win = function(r) {
+ console.log("コード = " + r.responseCode);
+ console.log("結果 = " + r.response);
+ console.log("送信バイト数 = " + r.bytesSent);
+ }
+
+ var fail = function(error) {
+ alert("エラーが発生しました: Code = " + error.code);
+ console.log("upload error source " + error.source);
+ console.log("upload error target " + error.target);
+ }
+
+ var options = new FileUploadOptions();
+ options.fileKey="file";
+ options.fileName=fileURI.substr(fileURI.lastIndexOf('/')+1);
+ options.mimeType="text/plain";
+
+ var params = {};
+ params.value1 = "test";
+ params.value2 = "param";
+
+ options.params = params;
+
+ var ft = new FileTransfer();
+ ft.upload(fileURI, encodeURI("http://some.server.com/upload.php"), win, fail, options);
+
+__詳細な使用例__
+
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+ <html>
+ <head>
+ <title>File Transfer の使用例</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova-2.2.0.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Cordova の読み込み完了まで待機
+ //
+ document.addEventListener("deviceready", onDeviceReady, false);
+
+ // Cordova 準備完了
+ //
+ function onDeviceReady() {
+
+ // 写真をファイル URI として取得する場合
+ navigator.camera.getPicture(uploadPhoto,
+ function(message) { alert('写真の取得に失敗しました'); },
+ { quality: 50,
+ destinationType: navigator.camera.DestinationType.FILE_URI,
+ sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY }
+ );
+
+ }
+
+ function uploadPhoto(imageURI) {
+ var options = new FileUploadOptions();
+ options.fileKey="file";
+ options.fileName=imageURI.substr(imageURI.lastIndexOf('/')+1);
+ options.mimeType="image/jpeg";
+
+ var params = {};
+ params.value1 = "test";
+ params.value2 = "param";
+
+ options.params = params;
+
+ var ft = new FileTransfer();
+ ft.upload(imageURI, encodeURI("http://some.server.com/upload.php"), win, fail, options);
+ }
+
+ function win(r) {
+ console.log("コード = " + r.responseCode);
+ console.log("結果 = " + r.response);
+ console.log("送信バイト数 = " + r.bytesSent);
+ }
+
+ function fail(error) {
+ alert("エラーが発生しました: Code = " + error.code);
+ console.log("upload error source " + error.source);
+ console.log("upload error target " + error.target);
+ }
+
+ </script>
+ </head>
+ <body>
+ <h1>使用例</h1>
+ <p>ファイルアップロード</p>
+ </body>
+ </html>
+
+__アップロードヘッダーの設定__
+
+Android と iOS でサポートされています。
+
+ function win(r) {
+ console.log("コード = " + r.responseCode);
+ console.log("結果 = " + r.response);
+ console.log("送信バイト数 = " + r.bytesSent);
+ }
+
+ function fail(error) {
+ alert("エラーが発生しました: Code = " + error.code);
+ console.log("upload error source " + error.source);
+ console.log("upload error target " + error.target);
+ }
+
+ var uri = encodeURI("http://some.server.com/upload.php");
+
+ var options = new FileUploadOptions();
+ options.fileKey="file";
+ options.fileName=fileURI.substr(fileURI.lastIndexOf('/')+1);
+ options.mimeType="text/plain";
+
+ var params = {};
+ params.headers={'headerParam':'headerValue'};
+
+ options.params = params;
+
+ var ft = new FileTransfer();
+ ft.upload(fileURI, uri, win, fail, options);
+
+__Android に関する注意点__
+
+Nginx サーバーへのアップロードで問題が発生した場合は、 chunkedMode オプションが false にセットされていることを確認してください。
+
+download
+--------------
+
+__パラメーター:__
+
+- __source__ - ファイルを取得するサーバーの URL を表します (encodeURI() を使用して既にエンコードされている必要があります)
+- __target__ - デバイス内のファイルのフルパスを表します
+- __successCallback__ - FileEntry オブジェクトを伴って呼び出されるコールバック関数を表します _(Function)_
+- __errorCallback__ - Metadata の取得時にエラーが起きた場合に呼び出されるコールバック関数を表します。 FileError オブジェクトを伴って呼び出されます _(Function)_
+
+__使用例__
+
+ // !! filePath がデバイス内の有効な値であるとみなします
+
+ var fileTransfer = new FileTransfer();
+ var uri = encodeURI("http://some.server.com/download.php");
+
+ fileTransfer.download(
+ url,
+ filePath,
+ function(entry) {
+ console.log("ダウンロード完了: " + entry.fullPath);
+ },
+ function(error) {
+ console.log("download error source " + error.source);
+ console.log("download error target " + error.target);
+ console.log("upload error code" + error.code);
+ }
+ );
+
+abort
+--------------
+
+進行中の転送を中止します。 FileTransferError.ABORT_ERR エラーコードを持つ FileTransferError オブジェクトを伴って onerror コールバックが呼び出されます。
+
+__サポートされているプラットフォーム__
+
+- Android
+- iOS
+
+onprogress
+--------------
+
+ProgressEvent とともに、新しいデーターの塊が転送される度に呼び出されます。
+
+__サポートされているプラットフォーム__
+
+- Android
+- iOS
+
+__使用例__
+
+ fileTransfer.onprogress = function(progressEvent) {
+ if (progressEvent.lengthComputable) {
+ loadingStatus.setPercentage(progressEvent.loaded / progressEvent.total);
+ } else {
+ loadingStatus.increment();
+ }
+ };
+ fileTransfer.download(...); // または fileTransfer.upload(...);
+
+__注意点__
+- Android と iOS の両方で、 gzip エンコーディングを用いるダウンロードの際には lengthComputable が false になります。
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/e7168dd7/docs/ja/2.2.0/cordova/file/filetransfererror/filetransfererror.md
----------------------------------------------------------------------
diff --git a/docs/ja/2.2.0/cordova/file/filetransfererror/filetransfererror.md b/docs/ja/2.2.0/cordova/file/filetransfererror/filetransfererror.md
new file mode 100644
index 0000000..a426699
--- /dev/null
+++ b/docs/ja/2.2.0/cordova/file/filetransfererror/filetransfererror.md
@@ -0,0 +1,44 @@
+---
+license: 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.
+---
+
+FileTransferError
+========
+
+`FileTransferError` オブジェクトは、エラーが発生したときエラーコールバック関数に渡されます。
+
+プロパティー
+----------
+
+- __code__ 事前に定義された以下のエラーコードのうちの1つを表します (Number)
+- __source__ ソースの URI を表します (String)
+- __target__ ターゲットの URI を表します (String)
+- __http_status__ HTTP のステータスコードを表します。この属性は、レスポンスコードが HTTP コネクションから返されたときのみ有効です (Number)
+
+定数
+---------
+
+- `FileTransferError.FILE_NOT_FOUND_ERR`
+- `FileTransferError.INVALID_URL_ERR`
+- `FileTransferError.CONNECTION_ERR`
+- `FileTransferError.ABORT_ERR`
+
+概要
+-----------
+
+`FileTransferError` オブジェクトは、ファイルアップロードまたはダウンロード時にエラーが発生したときエラーコールバック関数に渡されます。
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/e7168dd7/docs/ja/2.2.0/cordova/file/fileuploadoptions/fileuploadoptions.md
----------------------------------------------------------------------
diff --git a/docs/ja/2.2.0/cordova/file/fileuploadoptions/fileuploadoptions.md b/docs/ja/2.2.0/cordova/file/fileuploadoptions/fileuploadoptions.md
new file mode 100644
index 0000000..df0ddbb
--- /dev/null
+++ b/docs/ja/2.2.0/cordova/file/fileuploadoptions/fileuploadoptions.md
@@ -0,0 +1,45 @@
+---
+license: 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.
+---
+
+FileUploadOptions
+========
+
+`FileUploadOptions` オブジェクトは upload メソッドを実行する際に FileTransfer オブジェクトに渡して、追加のパラメーターとして設定する場合に使用します。
+
+プロパティー
+----------
+
+- __fileKey:__ フォーム要素の名前を指定します。 デフォルトは "file" です (DOMString)
+- __fileName:__ サーバーに保存する際のファイル名を指定します。 デフォルトは "image.jpg" です (DOMString)
+- __mimeType:__ データの MIME 形式を指定します。 デフォルトは "image/jpeg" です (DOMString)
+- __params:__ その他の HTTP リクエストで送信されるパラメーターを指定します (Object)
+- __chunkedMode:__ アップロードにチャンクドストリーミングモードを使用するかを指定します。 デフォルトは "true" です (Boolean)
+- __headers:__ ヘッダー名 => ヘッダー値の Map を指定します。ヘッダーへ複数の値を設定するには、配列を使用します (Object)
+
+
+概要
+-----------
+
+`FileUploadOptions` オブジェクトは upload メソッドを実行する際に FileTransfer オブジェクトに渡して、追加のパラメーターとして設定する場合に使用します。
+
+WP7 に関する注意点
+---------
+
+- __chunkedMode:__
+ WP7 ではこの値は無視されます。
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/e7168dd7/docs/ja/2.2.0/cordova/file/fileuploadresult/fileuploadresult.md
----------------------------------------------------------------------
diff --git a/docs/ja/2.2.0/cordova/file/fileuploadresult/fileuploadresult.md b/docs/ja/2.2.0/cordova/file/fileuploadresult/fileuploadresult.md
new file mode 100644
index 0000000..e366c58
--- /dev/null
+++ b/docs/ja/2.2.0/cordova/file/fileuploadresult/fileuploadresult.md
@@ -0,0 +1,39 @@
+---
+license: 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.
+---
+
+FileUploadResult
+========
+
+`FileUploadResult` オブジェクトは、 FileTransfer の upload メソッドの呼び出しが成功した時に、成功コールバック関数に渡されるオブジェクトです。
+
+プロパティー
+----------
+
+- __bytesSent:__ 送信されたバイト数を表します (long)
+- __responseCode:__ サーバーから返された HTTP のレスポンスコードを表します (long)
+- __response:__ サーバーから返された HTTP のレスポンスを表します (DOMString)
+
+概要
+-----------
+
+`FileUploadResult` オブジェクトは、 FileTransfer の upload メソッドの呼び出しが成功した時に、成功コールバック関数に渡されるオブジェクトです。
+
+iOS に関する注意点
+----------
+- iOS では、成功コールバック関数に渡される FileUploadResult オブジェクトには、 responseCode も bytesSent も含まれません。
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/e7168dd7/docs/ja/2.2.0/cordova/file/filewriter/filewriter.md
----------------------------------------------------------------------
diff --git a/docs/ja/2.2.0/cordova/file/filewriter/filewriter.md b/docs/ja/2.2.0/cordova/file/filewriter/filewriter.md
new file mode 100644
index 0000000..1605c0c
--- /dev/null
+++ b/docs/ja/2.2.0/cordova/file/filewriter/filewriter.md
@@ -0,0 +1,194 @@
+---
+license: 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.
+---
+
+FileWriter
+==========
+
+FileWriter はファイルへの書き込みを行うオブジェクトです。
+
+プロパティー
+----------
+
+- __readyState:__ 右の3種類の状態のいずれかを表します (INIT, WRITING, DONE)
+- __fileName:__ 書き込みの対象となるファイル名を表します _(DOMString)_
+- __length:__ 書き込みの対象となるファイル名を表します _(long)_
+- __position:__ ファイルポインタの現在の位置を表します _(long)_
+- __error:__ エラー情報を表します _(FileError)_
+- __onwritestart:__ 書き込み開始時に呼ばれる関数を表します _(Function)_
+- __onprogress:__ ファイル書き込み中に呼ばれ、進捗状況を報告する関数を表します (progess.loaded/progress.total) _(Function)_ - 現在サポートされていません
+- __onwrite:__ リクエストが成功したときに呼ばれる関数を表します _(Function)_
+- __onabort:__ abort() メソッドを実行したときなど、 書き込みが強制終了したときに呼ばれる関数を表します _(Function)_
+- __onerror:__ 書き込みが失敗したときに呼ばれる関数を表します _(Function)_
+- __onwriteend:__ 成功、失敗にかかわらずリクエストが完了した際に呼ばれる関数を表します _(Function)_
+
+メソッド
+-------
+
+- __abort__: 書き込みを中断します
+- __seek__: ファイルポインタを指定したバイトまで移動します
+- __truncate__: ファイルを指定した長さに切り詰めます
+- __write__: ファイルにデータを UTF-8 エンコーディングで書き込みます
+
+詳細
+-------
+
+`FileWriter` オブジェクトはデバイスのファイルシステムに書きこむ際に使用します。また、 writestart, progress, write, writeend, error や abort などのイベントを受け取るための独自のイベントリスナーを登録することも出来ます。
+
+FileWriter は一つのファイルに対して使用されます。複数回の書き込みを行うこともできます。 FileWriter はファイルポインタの位置と length 属性を指定することができるので、ファイルのどの位置からでも書き込みを行うことができます。デフォルトではファイルの開始位置にポインタがセットされ、既存のデータを上書きしながら書き込みが行われます。書き込みをファイルの最終から始める場合は、 FileWriter のコンストラクタに true をオプションとして指定してください。
+
+サポートされているプラットフォーム
+-------------------
+
+- Android
+- BlackBerry WebWorks (OS 5.0 以上)
+- iOS
+- Windows Phone 7 (Mango)
+
+Seek の例
+------------------------------
+
+ function win(writer) {
+ // ファイルポインタを EOF (ファイルの終端) に移動
+ writer.seek(writer.length);
+ };
+
+ var fail = function(error) {
+ console.log(error.code);
+ };
+
+ entry.createWriter(win, fail);
+
+Truncate の例
+--------------------------
+
+ function win(writer) {
+ writer.truncate(10);
+ };
+
+ var fail = function(error) {
+ console.log(error.code);
+ };
+
+ entry.createWriter(win, fail);
+
+Write の例
+-------------------
+
+ function win(writer) {
+ writer.onwrite = function(evt) {
+ console.log("書き込み成功");
+ };
+ writer.write("サンプルテキスト");
+ };
+
+ var fail = function(error) {
+ console.log(error.code);
+ };
+
+ entry.createWriter(win, fail);
+
+Append の例
+--------------------
+
+ function win(writer) {
+ writer.onwrite = function(evt) {
+ console.log("書き込み成功");
+ };
+ writer.seek(writer.length);
+ writer.write("付加テキスト);
+ };
+
+ var fail = function(error) {
+ console.log(error.code);
+ };
+
+ entry.createWriter(win, fail);
+
+Abort の例
+-------------------
+
+ function win(writer) {
+ writer.onwrite = function(evt) {
+ console.log("書き込み成功");
+ };
+ writer.write("サンプルテキスト");
+ writer.abort();
+ };
+
+ var fail = function(error) {
+ console.log(error.code);
+ };
+
+ entry.createWriter(win, fail);
+
+詳細な使用例
+------------
+ <!DOCTYPE html>
+ <html>
+ <head>
+ <title>FileWriter の使用例</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova-2.2.0.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Cordova の読み込み完了まで待機
+ //
+ document.addEventListener("deviceready", onDeviceReady, false);
+
+ // Cordova 準備完了
+ //
+ function onDeviceReady() {
+ window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFS, fail);
+ }
+
+ function gotFS(fileSystem) {
+ fileSystem.root.getFile("readme.txt", {create: true, exclusive: false}, gotFileEntry, fail);
+ }
+
+ function gotFileEntry(fileEntry) {
+ fileEntry.createWriter(gotFileWriter, fail);
+ }
+
+ function gotFileWriter(writer) {
+ writer.onwriteend = function(evt) {
+ console.log("ファイルの内容が 'some sample text' となりました");
+ writer.truncate(11);
+ writer.onwriteend = function(evt) {
+ console.log("ファイルの内容が 'some sample' となりました");
+ writer.seek(4);
+ writer.write(" different text");
+ writer.onwriteend = function(evt){
+ console.log("ファイルの内容が 'some different text' となりました");
+ }
+ };
+ };
+ writer.write("サンプルテキスト");
+ }
+
+ function fail(error) {
+ console.log(error.code);
+ }
+
+ </script>
+ </head>
+ <body>
+ <h1>使用例</h1>
+ <p>ファイルに書き込みます。</p>
+ </body>
+ </html>
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/e7168dd7/docs/ja/2.2.0/cordova/file/flags/flags.md
----------------------------------------------------------------------
diff --git a/docs/ja/2.2.0/cordova/file/flags/flags.md b/docs/ja/2.2.0/cordova/file/flags/flags.md
new file mode 100644
index 0000000..b7443af
--- /dev/null
+++ b/docs/ja/2.2.0/cordova/file/flags/flags.md
@@ -0,0 +1,46 @@
+---
+license: 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.
+---
+
+Flags
+=====
+
+このオブジェクトは、 `DirectoryEntry` の __getFile__ メソッドと __getDirectory__ メソッド (ファイルやディレクトリを取得または作成するメソッド) に渡される引数として使われます。
+
+プロパティー
+----------
+
+- __create:__ もし対象のファイルまたはディレクトリが無かった場合、作成するかどうかを表します _(boolean)_
+- __exclusive:__ このプロパティー単体では効果はありません。 create プロパティーと一緒に使います。もし対象のパスが既に存在した場合は、取得するのではなくファイルまたはディレクトリの作成に失敗します _(boolean)_
+
+サポートされているプラットフォーム
+-------------------
+
+- Android
+- BlackBerry WebWorks (OS 5.0 以上)
+- iOS
+- Windows Phone 7 (Mango)
+
+使用例
+-------------
+
+ // data ディレクトリを取得します。もし存在しない場合は、作成します
+ dataDir = fileSystem.root.getDirectory("data", {create: true});
+
+ // lockfile.txt ファイルを、存在しない場合のみ作成します
+ lockFile = dataDir.getFile("lockfile.txt", {create: true, exclusive: true});
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/e7168dd7/docs/ja/2.2.0/cordova/file/localfilesystem/localfilesystem.md
----------------------------------------------------------------------
diff --git a/docs/ja/2.2.0/cordova/file/localfilesystem/localfilesystem.md b/docs/ja/2.2.0/cordova/file/localfilesystem/localfilesystem.md
new file mode 100644
index 0000000..74ac261
--- /dev/null
+++ b/docs/ja/2.2.0/cordova/file/localfilesystem/localfilesystem.md
@@ -0,0 +1,110 @@
+---
+license: 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.
+---
+
+LocalFileSystem
+===============
+
+このオブジェクトは、ファイルシステムのルートの取得方法を提供します。
+
+メソッド
+----------
+
+- __requestFileSystem:__ ファイルシステムをリクエストします _(Function)_
+- __resolveLocalFileSystemURI:__ ローカル URI を使用して DirectoryEntry または FileEntry を取得します _(Function)_
+
+定数
+---------
+
+- `LocalFileSystem.PERSISTENT`: アプリやユーザーの許可なしに、ユーザエージェントのみでは削除されないような永続的なストレージを表します
+- `LocalFileSystem.TEMPORARY`: 永続性が保証されていないようなストレージを表します
+
+詳細
+-------
+
+`LocalFileSystem` オブジェクトのメソッドは __window__ オブジェクトに定義されています。
+
+サポートされているプラットフォーム
+-------------------
+
+- Android
+- BlackBerry WebWorks (OS 5.0 以上)
+- iOS
+- Windows Phone 7 (Mango)
+
+Request File Systemの使用例
+---------------------------------
+
+ function onSuccess(fileSystem) {
+ console.log(fileSystem.name);
+ }
+
+ // ファイルシステムをリクエスト
+ window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onSuccess, onError);
+
+Resolve Local File System URIの使用例
+-------------------------------------------
+
+ function onSuccess(fileEntry) {
+ console.log(fileEntry.name);
+ }
+
+ window.resolveLocalFileSystemURI("file:///example.txt", onSuccess, onError);
+
+詳細な使用例
+------------
+
+
+ <!DOCTYPE html>
+ <html>
+ <head>
+ <title>Local File System の使用例</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova-2.2.0.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Cordova の読み込み完了まで待機
+ //
+ document.addEventListener("deviceready", onDeviceReady, false);
+
+ // Cordova 準備完了
+ //
+ function onDeviceReady() {
+ window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onFileSystemSuccess, fail);
+ window.resolveLocalFileSystemURI("file:///example.txt", onResolveSuccess, fail);
+ }
+
+ function onFileSystemSuccess(fileSystem) {
+ console.log(fileSystem.name);
+ }
+
+ function onResolveSuccess(fileEntry) {
+ console.log(fileEntry.name);
+ }
+
+ function fail(error) {
+ console.log(error.code);
+ }
+
+ </script>
+ </head>
+ <body>
+ <h1>使用例</h1>
+ <p>Local File System</p>
+ </body>
+ </html>
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/e7168dd7/docs/ja/2.2.0/cordova/file/metadata/metadata.md
----------------------------------------------------------------------
diff --git a/docs/ja/2.2.0/cordova/file/metadata/metadata.md b/docs/ja/2.2.0/cordova/file/metadata/metadata.md
new file mode 100644
index 0000000..34a2ec1
--- /dev/null
+++ b/docs/ja/2.2.0/cordova/file/metadata/metadata.md
@@ -0,0 +1,51 @@
+---
+license: 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.
+---
+
+Metadata
+==========
+
+ファイルやディレクトリの状態を提供します。
+
+プロパティー
+----------
+
+- __modificationTime:__ ファイルまたはディレクトリの最終更新日時を表します _(Date)_
+
+詳細
+-------
+
+`Metadata` オブジェクトは、ファイルやディレクトリの状態を表します。 `DirectoryEntry` または `FileEntry` の __getMetadata__ メソッドを呼び出すことで、 Metadata オブジェクトが取得できます。
+
+サポートされているプラットフォーム
+-------------------
+
+- Android
+- BlackBerry WebWorks (OS 5.0 以上)
+- iOS
+- Windows Phone 7 (Mango)
+
+使用例
+-------------
+
+ function win(metadata) {
+ console.log("最終更新日: " + metadata.modificationTime);
+ }
+
+ // このエントリーの Metadata オブジェクトを取得
+ entry.getMetadata(win, null);
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/e7168dd7/docs/ja/2.2.0/cordova/geolocation/Coordinates/coordinates.md
----------------------------------------------------------------------
diff --git a/docs/ja/2.2.0/cordova/geolocation/Coordinates/coordinates.md b/docs/ja/2.2.0/cordova/geolocation/Coordinates/coordinates.md
new file mode 100644
index 0000000..bc3a4e8
--- /dev/null
+++ b/docs/ja/2.2.0/cordova/geolocation/Coordinates/coordinates.md
@@ -0,0 +1,126 @@
+---
+license: 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.
+---
+
+Coordinates
+===========
+
+位置情報で使用される座標を格納します。
+
+プロパティー
+----------
+
+* __latitude__: 緯度を数値で表します _(Number)_
+* __longitude__: 経度を数値で表します _(Number)_
+* __altitude__: 海抜からの高度をメートル単位で表します _(Number)_
+* __accuracy__: 位置の精度をメートル単位で表します _(Number)_
+* __altitudeAccuracy__: 高度の精度をメートル単位で表します _(Number)_
+* __heading__: 北から時計回りでのデバイスの方位を角度で表します _(Number)_
+* __speed__: 現在のデバイスのスピードをメートル/秒で表します _(Number)_
+
+概要
+-----------
+
+`Coordinates` オブジェクトは `Position` オブジェクトのプロパティーとして作成されます。 `Position` オブジェクトはコールバック関数を通してユーザーに返されます。
+
+サポートされているプラットフォーム
+-------------------
+
+- Android
+- BlackBerry WebWorks (OS 5.0 以上)
+- iOS
+- Windows Phone 7 (Mango)
+- Bada 1.2 & 2.x
+- webOS
+- Tizen
+
+使用例
+-------------
+
+ // 成功時のコールバック関数
+ //
+ var onSuccess = function(position) {
+ alert('緯度: ' + position.coords.latitude + '\n' +
+ '経度: ' + position.coords.longitude + '\n' +
+ '高度: ' + position.coords.altitude + '\n' +
+ '位置精度: ' + position.coords.accuracy + '\n' +
+ '高度精度: ' + position.coords.altitudeAccuracy + '\n' +
+ '方位: ' + position.coords.heading + '\n' +
+ '速度: ' + position.coords.speed + '\n' +
+ 'タイムスタンプ: ' + position.timestamp + '\n');
+ };
+
+ // エラー時のコールバック関数
+ //
+ var onError = function() {
+ alert('エラーが発生しました。');
+ };
+
+ navigator.geolocation.getCurrentPosition(onSuccess, onError);
+
+詳細な使用例
+------------
+
+ <!DOCTYPE html>
+ <html>
+ <head>
+ <title>位置情報の使用例</title>
+ <script type="text/javascript" charset="utf-8" src="cordova-2.2.0.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Cordovaの読み込み完了まで待機
+ //
+ document.addEventListener("deviceready", onDeviceReady, false);
+
+ // Cordova準備完了
+ //
+ function onDeviceReady() {
+ navigator.geolocation.getCurrentPosition(onSuccess, onError);
+ }
+
+ // `Position` プロパティーを表示
+ //
+ function onSuccess(position) {
+ var div = document.getElementById('myDiv');
+
+ div.innerHTML = '緯度: ' + position.coords.latitude + '<br/>' +
+ '経度: ' + position.coords.longitude + '<br/>' +
+ '高度: ' + position.coords.altitude + '<br/>' +
+ '位置精度: ' + position.coords.accuracy + '<br/>' +
+ '高度精度: ' + position.coords.altitudeAccuracy + '<br/>' +
+ '方位: ' + position.coords.heading + '<br/>' +
+ '速度: ' + position.coords.speed + '<br/>';
+ }
+
+ // エラー発生時に警告を表示
+ //
+ function onError() {
+ alert('エラーが発生しました。');
+ }
+
+ </script>
+ </head>
+ <body>
+ <div id="myDiv"></div>
+ </body>
+ </html>
+
+Android に関する注意点
+-------------
+
+このプロパティーは Android ではサポートされておらず、常に null を返します。
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/e7168dd7/docs/ja/2.2.0/cordova/geolocation/Position/position.md
----------------------------------------------------------------------
diff --git a/docs/ja/2.2.0/cordova/geolocation/Position/position.md b/docs/ja/2.2.0/cordova/geolocation/Position/position.md
new file mode 100644
index 0000000..b73768b
--- /dev/null
+++ b/docs/ja/2.2.0/cordova/geolocation/Position/position.md
@@ -0,0 +1,119 @@
+---
+license: 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.
+---
+
+Position
+========
+
+geolocation API によって作成された位置情報とタイムスタンプ (`Position`) とを扱うオブジェクトです。
+
+プロパティー
+----------
+
+- __coords:__ 地理座標を表します _(Coordinates)_
+- __timestamp:__ タイムスタンプ値を表します _(Date)_
+
+概要
+-----------
+
+`Position` オブジェクトは Cordova によって作られ、コールバック関数を通してユーザーに返されます。
+
+サポートされているプラットフォーム
+-------------------
+
+- Android
+- BlackBerry WebWorks (OS 5.0 以上)
+- iOS
+- Windows Phone 7 (Mango)
+- Bada 1.2 & 2.x
+- webOS
+- Tizen
+
+使用例
+-------------
+
+ // 成功時のコールバック関数
+ //
+ var onSuccess = function(position) {
+ alert('緯度: ' + position.coords.latitude + '\n' +
+ '経度: ' + position.coords.longitude + '\n' +
+ '高度: ' + position.coords.altitude + '\n' +
+ '位置精度: ' + position.coords.accuracy + '\n' +
+ '高度精度: ' + position.coords.altitudeAccuracy + '\n' +
+ '方位: ' + position.coords.heading + '\n' +
+ '速度: ' + position.coords.speed + '\n' +
+ 'タイムスタンプ: ' + position.timestamp + '\n');
+ };
+
+ // エラー時のコールバック関数は PositionError オブジェクトを受けとる
+ //
+ function onError(error) {
+ alert('コード: ' + error.code + '\n' +
+ 'メッセージ: ' + error.message + '\n');
+ }
+
+ navigator.geolocation.getCurrentPosition(onSuccess, onError);
+
+詳細な使用例
+------------
+
+ <!DOCTYPE html>
+ <html>
+ <head>
+ <title>デバイスプロパティーの使用例</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova-2.2.0.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Cordova の読み込み完了まで待機
+ //
+ document.addEventListener("deviceready", onDeviceReady, false);
+
+ // Cordova 準備完了
+ //
+ function onDeviceReady() {
+ navigator.geolocation.getCurrentPosition(onSuccess, onError);
+ }
+
+ // onSuccess Geolocation
+ //
+ function onSuccess(position) {
+ var element = document.getElementById('geolocation');
+ element.innerHTML = '緯度: ' + position.coords.latitude + '<br />' +
+ '経度: ' + position.coords.longitude + '<br />' +
+ '高度: ' + position.coords.altitude + '<br />' +
+ '位置精度: ' + position.coords.accuracy + '<br />' +
+ '高度精度: ' + position.coords.altitudeAccuracy + '<br />' +
+ '方位: ' + position.coords.heading + '<br />' +
+ '速度: ' + position.coords.speed + '<br />' +
+ 'タイムスタンプ: ' + position.timestamp + '<br />';
+ }
+
+ // エラー時のコールバック関数は PositionError オブジェクトを受けとる
+ //
+ function onError(error) {
+ alert('コード: ' + error.code + '\n' +
+ 'メッセージ: ' + error.message + '\n');
+ }
+
+ </script>
+ </head>
+ <body>
+ <p id="geolocation">位置情報を取得中...</p>
+ </body>
+ </html>
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/e7168dd7/docs/ja/2.2.0/cordova/geolocation/PositionError/positionError.md
----------------------------------------------------------------------
diff --git a/docs/ja/2.2.0/cordova/geolocation/PositionError/positionError.md b/docs/ja/2.2.0/cordova/geolocation/PositionError/positionError.md
new file mode 100755
index 0000000..ffd7e10
--- /dev/null
+++ b/docs/ja/2.2.0/cordova/geolocation/PositionError/positionError.md
@@ -0,0 +1,53 @@
+---
+license: 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.
+---
+
+PositionError
+========
+
+`PositionError` オブジェクトは、エラーが発生したときに `geolocationError` コールバック関数に渡されます。
+
+プロパティー
+----------
+
+- __code:__ 事前に定義された以下のエラーコードのうちの1つを表します
+- __message:__ エラーの内容を表すエラーメッセージを表します
+
+定数
+---------
+
+- `PositionError.PERMISSION_DENIED`
+- `PositionError.POSITION_UNAVAILABLE`
+- `PositionError.TIMEOUT`
+
+概要
+-----------
+
+`PositionError` オブジェクトは、位置情報取得に関するエラーが発生したときに `geolocationError` コールバック関数を通してユーザーに返されます。
+
+### `PositionError.PERMISSION_DENIED`
+
+ユーザーがアプリケーションに対して、位置情報の取得を許可しなかった場合に返されます。これはプラットフォームに依存します。
+
+### `PositionError.POSITION_UNAVAILABLE`
+
+デバイスが位置を取得できなかった場合に返されます。大抵、これはデバイスがネットワークに接続されていない、および/または衛生情報が取得出来なかったことを意味します。
+
+### `PositionError.TIMEOUT`
+
+デバイスが、 `geolocationOptions` の `timeout` プロパティーによって指定された時間内に位置が取得できなかった場合に返されます。 `geolocation.watchPosition` と一緒に使用するとき、このエラーは `geolocationError` コールバックの中で毎 `timeout` ミリ秒後呼ばれる可能性があります。
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/e7168dd7/docs/ja/2.2.0/cordova/geolocation/geolocation.clearWatch.md
----------------------------------------------------------------------
diff --git a/docs/ja/2.2.0/cordova/geolocation/geolocation.clearWatch.md b/docs/ja/2.2.0/cordova/geolocation/geolocation.clearWatch.md
new file mode 100644
index 0000000..b5ca578
--- /dev/null
+++ b/docs/ja/2.2.0/cordova/geolocation/geolocation.clearWatch.md
@@ -0,0 +1,118 @@
+---
+license: 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.
+---
+
+geolocation.clearWatch
+======================
+
+watch ID パラメーターによって参照されるデバイスの位置情報の監視を停止します。
+
+ navigator.geolocation.clearWatch(watchID);
+
+パラメーター
+----------
+
+- __watchID:__ `watchPosition` 関数での監視を停止したい watchID を表します (String)
+
+概要
+-----------
+
+`geolocation.clearWatch` 関数は、 `watchID` によって参照される `geolocation.watchPosition` 関数を停止させるによって、位置情報の監視を停止します。
+
+サポートされているプラットフォーム
+-------------------
+
+- Android
+- BlackBerry WebWorks (OS 5.0 以上)
+- iOS
+- Windows Phone 7 (Mango)
+- Bada 1.2 & 2.x
+- webOS
+- Tizen
+
+使用例
+-------------
+
+ // 位置の変化を監視し、取得可能なもっとも精度の高い位置を使います
+ // (オプション)
+ //
+ var watchID = navigator.geolocation.watchPosition(onSuccess, onError, { enableHighAccuracy: true });
+
+ // ... 後に続く ...
+
+ navigator.geolocation.clearWatch(watchID);
+
+
+詳細な使用例
+------------
+
+ <!DOCTYPE html>
+ <html>
+ <head>
+ <title>デバイスプロパティーの使用例</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova-2.2.0.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Cordova の読み込み完了まで待機
+ //
+ document.addEventListener("deviceready", onDeviceReady, false);
+
+ var watchID = null;
+
+ // Cordova 準備完了
+ //
+ function onDeviceReady() {
+ // デバイスで有効な最も制度の高い位置で更新
+ //
+ var options = { enableHighAccuracy: true };
+ watchID = navigator.geolocation.watchPosition(onSuccess, onError, options);
+ }
+
+ // onSuccess Geolocation
+ //
+ function onSuccess(position) {
+ var element = document.getElementById('geolocation');
+ element.innerHTML = '緯度: ' + position.coords.latitude + '<br />' +
+ '経度: ' + position.coords.longitude + '<br />' +
+ '<hr />' + element.innerHTML;
+ }
+
+ // 先に開始された監視を停止する
+ //
+ function clearWatch() {
+ if (watchID != null) {
+ navigator.geolocation.clearWatch(watchID);
+ watchID = null;
+ }
+ }
+
+ // エラー時のコールバック関数は PositionError オブジェクトを受けとる
+ //
+ function onError(error) {
+ alert('コード: ' + error.code + '\n' +
+ 'メッセージ: ' + error.message + '\n');
+ }
+
+ </script>
+ </head>
+ <body>
+ <p id="geolocation">位置情報を監視中...</p>
+ <button onclick="clearWatch();">監視の停止</button>
+ </body>
+ </html>
http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/e7168dd7/docs/ja/2.2.0/cordova/geolocation/geolocation.getCurrentPosition.md
----------------------------------------------------------------------
diff --git a/docs/ja/2.2.0/cordova/geolocation/geolocation.getCurrentPosition.md b/docs/ja/2.2.0/cordova/geolocation/geolocation.getCurrentPosition.md
new file mode 100644
index 0000000..1766fa9
--- /dev/null
+++ b/docs/ja/2.2.0/cordova/geolocation/geolocation.getCurrentPosition.md
@@ -0,0 +1,127 @@
+---
+license: 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.
+---
+
+geolocation.getCurrentPosition
+==============================
+
+デバイスの現在位置を `Position` オブジェクトとして返します。
+
+ navigator.geolocation.getCurrentPosition(geolocationSuccess,
+ [geolocationError],
+ [geolocationOptions]);
+
+パラメーター
+----------
+
+- __geolocationSuccess__: 現在位置情報の取得成功時に呼ばれるコールバック関数を表します
+- __geolocationError__: (オプション) エラー発生時に呼ばれるコールバック関数を表します
+- __geolocationOptions__: (オプション) 位置情報取得のオプションを表します
+
+概要
+-----------
+
+`geolocation.getCurrentPositon` 関数は非同期関数です。 `geolocationSuccess` コールバック関数に、`Position` オブジェクトをパラメーターとしてデバイスの現在位置を返します。エラーが発生した場合、 `PositionError` オブジェクトとともに `geolocationError` コールバック関数が呼び出されます。
+
+
+サポートされているプラットフォーム
+-------------------
+
+- Android
+- BlackBerry WebWorks (OS 5.0 以上)
+- iOS
+- Windows Phone 7 (Mango)
+- Bada 1.2 & 2.x
+- webOS
+- Tizen
+
+使用例
+-------------
+
+ // 成功時のコールバック関数
+ // このメソッドは GPS の現在座標を保持する
+ // `Position` オブジェクトを引数とする
+ //
+ var onSuccess = function(position) {
+ alert('緯度: ' + position.coords.latitude + '\n' +
+ '経度: ' + position.coords.longitude + '\n' +
+ '高度: ' + position.coords.altitude + '\n' +
+ '位置精度: ' + position.coords.accuracy + '\n' +
+ '高度精度: ' + position.coords.altitudeAccuracy + '\n' +
+ '方位: ' + position.coords.heading + '\n' +
+ '速度: ' + position.coords.speed + '\n' +
+ 'タイムスタンプ: ' + position.timestamp + '\n');
+ };
+
+ // エラー時のコールバック関数は PositionError オブジェクトを受けとる
+ //
+ function onError(error) {
+ alert('コード: ' + error.code + '\n' +
+ 'メッセージ: ' + error.message + '\n');
+ }
+
+ navigator.geolocation.getCurrentPosition(onSuccess, onError);
+
+詳細な使用例
+------------
+
+ <!DOCTYPE html>
+ <html>
+ <head>
+ <title>デバイスプロパティーの使用例</title>
+
+ <script type="text/javascript" charset="utf-8" src="cordova-2.2.0.js"></script>
+ <script type="text/javascript" charset="utf-8">
+
+ // Cordova の読み込み完了まで待機
+ //
+ document.addEventListener("deviceready", onDeviceReady, false);
+
+ // Cordova 準備完了
+ //
+ function onDeviceReady() {
+ navigator.geolocation.getCurrentPosition(onSuccess, onError);
+ }
+
+ // onSuccess Geolocation
+ //
+ function onSuccess(position) {
+ var element = document.getElementById('geolocation');
+ element.innerHTML = '緯度: ' + position.coords.latitude + '<br />' +
+ '経度: ' + position.coords.longitude + '<br />' +
+ '高度: ' + position.coords.altitude + '<br />' +
+ '位置精度: ' + position.coords.accuracy + '<br />' +
+ '高度精度: ' + position.coords.altitudeAccuracy + '<br />' +
+ '方位: ' + position.coords.heading + '<br />' +
+ '速度: ' + position.coords.speed + '<br />' +
+ 'タイムスタンプ: ' + position.timestamp + '<br />';
+ }
+
+ // エラー時のコールバック関数は PositionError オブジェクトを受けとる
+ //
+ function onError(error) {
+ alert('コード: ' + error.code + '\n' +
+ 'メッセージ: ' + error.message + '\n');
+ }
+
+ </script>
+ </head>
+ <body>
+ <p id="geolocation">位置情報を取得中...</p>
+ </body>
+ </html>