Christian Matos vor 4 Jahren
Ursprung
Commit
cccd58eada
100 geänderte Dateien mit 0 neuen und 267392 gelöschten Zeilen
  1. 0
    30
      node_modules/cordova-plugin-file/.jshintrc
  2. 0
    1
      node_modules/cordova-plugin-file/.ratignore
  3. 0
    37
      node_modules/cordova-plugin-file/CONTRIBUTING.md
  4. 0
    202
      node_modules/cordova-plugin-file/LICENSE
  5. 0
    5
      node_modules/cordova-plugin-file/NOTICE
  6. 0
    833
      node_modules/cordova-plugin-file/README.md
  7. 0
    496
      node_modules/cordova-plugin-file/RELEASENOTES.md
  8. 0
    120
      node_modules/cordova-plugin-file/doc/plugins.md
  9. 0
    87
      node_modules/cordova-plugin-file/package.json
  10. 0
    260
      node_modules/cordova-plugin-file/plugin.xml
  11. 0
    294
      node_modules/cordova-plugin-file/src/android/AssetFilesystem.java
  12. 0
    223
      node_modules/cordova-plugin-file/src/android/ContentFilesystem.java
  13. 0
    134
      node_modules/cordova-plugin-file/src/android/DirectoryManager.java
  14. 0
    29
      node_modules/cordova-plugin-file/src/android/EncodingException.java
  15. 0
    29
      node_modules/cordova-plugin-file/src/android/FileExistsException.java
  16. 0
    1225
      node_modules/cordova-plugin-file/src/android/FileUtils.java
  17. 0
    331
      node_modules/cordova-plugin-file/src/android/Filesystem.java
  18. 0
    30
      node_modules/cordova-plugin-file/src/android/InvalidModificationException.java
  19. 0
    513
      node_modules/cordova-plugin-file/src/android/LocalFilesystem.java
  20. 0
    64
      node_modules/cordova-plugin-file/src/android/LocalFilesystemURL.java
  21. 0
    29
      node_modules/cordova-plugin-file/src/android/NoModificationAllowedException.java
  22. 0
    94
      node_modules/cordova-plugin-file/src/android/PendingRequests.java
  23. 0
    30
      node_modules/cordova-plugin-file/src/android/TypeMismatchException.java
  24. 0
    47
      node_modules/cordova-plugin-file/src/android/build-extras.gradle
  25. 0
    1059
      node_modules/cordova-plugin-file/src/browser/FileProxy.js
  26. 0
    30
      node_modules/cordova-plugin-file/src/ios/CDVAssetLibraryFilesystem.h
  27. 0
    253
      node_modules/cordova-plugin-file/src/ios/CDVAssetLibraryFilesystem.m
  28. 0
    157
      node_modules/cordova-plugin-file/src/ios/CDVFile.h
  29. 0
    1119
      node_modules/cordova-plugin-file/src/ios/CDVFile.m
  30. 0
    32
      node_modules/cordova-plugin-file/src/ios/CDVLocalFilesystem.h
  31. 0
    750
      node_modules/cordova-plugin-file/src/ios/CDVLocalFilesystem.m
  32. 0
    189
      node_modules/cordova-plugin-file/src/osx/CDVFile.h
  33. 0
    1056
      node_modules/cordova-plugin-file/src/osx/CDVFile.m
  34. 0
    32
      node_modules/cordova-plugin-file/src/osx/CDVLocalFilesystem.h
  35. 0
    733
      node_modules/cordova-plugin-file/src/osx/CDVLocalFilesystem.m
  36. 0
    1190
      node_modules/cordova-plugin-file/src/windows/FileProxy.js
  37. 0
    17
      node_modules/cordova-plugin-file/tests/package.json
  38. 0
    43
      node_modules/cordova-plugin-file/tests/plugin.xml
  39. 0
    93
      node_modules/cordova-plugin-file/tests/src/android/TestContentProvider.java
  40. 0
    4163
      node_modules/cordova-plugin-file/tests/tests.js
  41. 0
    1
      node_modules/cordova-plugin-file/tests/www/fixtures/asset-test/asset-test.txt
  42. 0
    378
      node_modules/cordova-plugin-file/types/index.d.ts
  43. 0
    117
      node_modules/cordova-plugin-file/www/DirectoryEntry.js
  44. 0
    72
      node_modules/cordova-plugin-file/www/DirectoryReader.js
  45. 0
    260
      node_modules/cordova-plugin-file/www/Entry.js
  46. 0
    78
      node_modules/cordova-plugin-file/www/File.js
  47. 0
    92
      node_modules/cordova-plugin-file/www/FileEntry.js
  48. 0
    46
      node_modules/cordova-plugin-file/www/FileError.js
  49. 0
    298
      node_modules/cordova-plugin-file/www/FileReader.js
  50. 0
    55
      node_modules/cordova-plugin-file/www/FileSystem.js
  51. 0
    41
      node_modules/cordova-plugin-file/www/FileUploadOptions.js
  52. 0
    30
      node_modules/cordova-plugin-file/www/FileUploadResult.js
  53. 0
    325
      node_modules/cordova-plugin-file/www/FileWriter.js
  54. 0
    36
      node_modules/cordova-plugin-file/www/Flags.js
  55. 0
    23
      node_modules/cordova-plugin-file/www/LocalFileSystem.js
  56. 0
    40
      node_modules/cordova-plugin-file/www/Metadata.js
  57. 0
    67
      node_modules/cordova-plugin-file/www/ProgressEvent.js
  58. 0
    48
      node_modules/cordova-plugin-file/www/android/FileSystem.js
  59. 0
    30
      node_modules/cordova-plugin-file/www/browser/FileSystem.js
  60. 0
    192
      node_modules/cordova-plugin-file/www/browser/Preparing.js
  61. 0
    26
      node_modules/cordova-plugin-file/www/browser/isChrome.js
  62. 0
    62
      node_modules/cordova-plugin-file/www/fileSystemPaths.js
  63. 0
    46
      node_modules/cordova-plugin-file/www/fileSystems-roots.js
  64. 0
    25
      node_modules/cordova-plugin-file/www/fileSystems.js
  65. 0
    29
      node_modules/cordova-plugin-file/www/ios/FileSystem.js
  66. 0
    29
      node_modules/cordova-plugin-file/www/osx/FileSystem.js
  67. 0
    81
      node_modules/cordova-plugin-file/www/requestFileSystem.js
  68. 0
    91
      node_modules/cordova-plugin-file/www/resolveLocalFileSystemURI.js
  69. 0
    18
      node_modules/cordova-plugin-nativestorage/.jshintrc
  70. 0
    4
      node_modules/cordova-plugin-nativestorage/.travis.yml
  71. 0
    201
      node_modules/cordova-plugin-nativestorage/LICENSE.md
  72. 0
    340
      node_modules/cordova-plugin-nativestorage/README.md
  73. 0
    84
      node_modules/cordova-plugin-nativestorage/package.json
  74. 0
    70
      node_modules/cordova-plugin-nativestorage/plugin.xml
  75. 0
    132
      node_modules/cordova-plugin-nativestorage/src/android/Crypto.java
  76. 0
    396
      node_modules/cordova-plugin-nativestorage/src/android/NativeStorage.java
  77. 0
    28
      node_modules/cordova-plugin-nativestorage/src/ios/NativeStorage.h
  78. 0
    298
      node_modules/cordova-plugin-nativestorage/src/ios/NativeStorage.m
  79. 0
    158
      node_modules/cordova-plugin-nativestorage/src/windows/NativeStorage.js
  80. 0
    418
      node_modules/cordova-plugin-nativestorage/tests/main.js
  81. 0
    28
      node_modules/cordova-plugin-nativestorage/tests/plugin.xml
  82. 0
    42
      node_modules/cordova-plugin-nativestorage/www/LocalStorageHandle.js
  83. 0
    23
      node_modules/cordova-plugin-nativestorage/www/NativeStorageError.js
  84. 0
    517
      node_modules/cordova-plugin-nativestorage/www/mainHandle.js
  85. 0
    31
      node_modules/cordova-sqlite-storage-dependencies/README.md
  86. BIN
      node_modules/cordova-sqlite-storage-dependencies/libs/sqlite-connector.jar
  87. BIN
      node_modules/cordova-sqlite-storage-dependencies/libs/sqlite-native-driver.jar
  88. 0
    51
      node_modules/cordova-sqlite-storage-dependencies/package.json
  89. 0
    268
      node_modules/cordova-sqlite-storage-dependencies/sql-asm-memory-growth.js
  90. 0
    229787
      node_modules/cordova-sqlite-storage-dependencies/sqlite3.c
  91. 0
    12168
      node_modules/cordova-sqlite-storage-dependencies/sqlite3.h
  92. 0
    29
      node_modules/cordova-sqlite-storage/.travis.yml
  93. 0
    34
      node_modules/cordova-sqlite-storage/AUTHORS.md
  94. 0
    489
      node_modules/cordova-sqlite-storage/CHANGES.md
  95. 0
    33
      node_modules/cordova-sqlite-storage/CONTRIBUTING.md
  96. 0
    143
      node_modules/cordova-sqlite-storage/HISTORY.md
  97. 0
    49
      node_modules/cordova-sqlite-storage/LICENSE.md
  98. 0
    1842
      node_modules/cordova-sqlite-storage/README.md
  99. 0
    1034
      node_modules/cordova-sqlite-storage/SQLitePlugin.coffee.md
  100. 0
    0
      node_modules/cordova-sqlite-storage/bin/test.ps1

+ 0
- 30
node_modules/cordova-plugin-file/.jshintrc Datei anzeigen

@@ -1,30 +0,0 @@
1
-{
2
-    "browser": true
3
-  , "devel": true
4
-  , "bitwise": true
5
-  , "undef": true
6
-  , "trailing": true
7
-  , "quotmark": false
8
-  , "indent": 4
9
-  , "unused": "vars"
10
-  , "latedef": "nofunc"
11
-  , "globals": {
12
-        "module": false,
13
-        "exports": false,
14
-        "require": false,
15
-        "cordova": false,
16
-        "File": true,
17
-        "FileSystem": true,
18
-        "FileReader": true,
19
-        "FileWriter": true,
20
-        "FileError": true,
21
-        "LocalFileSystem": true,
22
-        "Metadata": true,
23
-        "Flags": true,
24
-        "DirectoryEntry": true,
25
-        "resolveLocalFileSystemURL": false,
26
-        "requestFileSystem": true,
27
-        "FILESYSTEM_PREFIX": true,
28
-        "FILESYSTEM_PROTOCOL": true
29
-    }
30
-}

+ 0
- 1
node_modules/cordova-plugin-file/.ratignore Datei anzeigen

@@ -1 +0,0 @@
1
-asset-test.txt

+ 0
- 37
node_modules/cordova-plugin-file/CONTRIBUTING.md Datei anzeigen

@@ -1,37 +0,0 @@
1
-<!--
2
-#
3
-# Licensed to the Apache Software Foundation (ASF) under one
4
-# or more contributor license agreements.  See the NOTICE file
5
-# distributed with this work for additional information
6
-# regarding copyright ownership.  The ASF licenses this file
7
-# to you under the Apache License, Version 2.0 (the
8
-# "License"); you may not use this file except in compliance
9
-# with the License.  You may obtain a copy of the License at
10
-#
11
-# http://www.apache.org/licenses/LICENSE-2.0
12
-#
13
-# Unless required by applicable law or agreed to in writing,
14
-# software distributed under the License is distributed on an
15
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
-#  KIND, either express or implied.  See the License for the
17
-# specific language governing permissions and limitations
18
-# under the License.
19
-#
20
--->
21
-
22
-# Contributing to Apache Cordova
23
-
24
-Anyone can contribute to Cordova. And we need your contributions.
25
-
26
-There are multiple ways to contribute: report bugs, improve the docs, and
27
-contribute code.
28
-
29
-For instructions on this, start with the 
30
-[contribution overview](http://cordova.apache.org/contribute/).
31
-
32
-The details are explained there, but the important items are:
33
- - Sign and submit an Apache ICLA (Contributor License Agreement).
34
- - Have a Jira issue open that corresponds to your contribution.
35
- - Run the tests so your patch doesn't break existing functionality.
36
-
37
-We look forward to your contributions!

+ 0
- 202
node_modules/cordova-plugin-file/LICENSE Datei anzeigen

@@ -1,202 +0,0 @@
1
-
2
-                                 Apache License
3
-                           Version 2.0, January 2004
4
-                        http://www.apache.org/licenses/
5
-
6
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
-
8
-   1. Definitions.
9
-
10
-      "License" shall mean the terms and conditions for use, reproduction,
11
-      and distribution as defined by Sections 1 through 9 of this document.
12
-
13
-      "Licensor" shall mean the copyright owner or entity authorized by
14
-      the copyright owner that is granting the License.
15
-
16
-      "Legal Entity" shall mean the union of the acting entity and all
17
-      other entities that control, are controlled by, or are under common
18
-      control with that entity. For the purposes of this definition,
19
-      "control" means (i) the power, direct or indirect, to cause the
20
-      direction or management of such entity, whether by contract or
21
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
-      outstanding shares, or (iii) beneficial ownership of such entity.
23
-
24
-      "You" (or "Your") shall mean an individual or Legal Entity
25
-      exercising permissions granted by this License.
26
-
27
-      "Source" form shall mean the preferred form for making modifications,
28
-      including but not limited to software source code, documentation
29
-      source, and configuration files.
30
-
31
-      "Object" form shall mean any form resulting from mechanical
32
-      transformation or translation of a Source form, including but
33
-      not limited to compiled object code, generated documentation,
34
-      and conversions to other media types.
35
-
36
-      "Work" shall mean the work of authorship, whether in Source or
37
-      Object form, made available under the License, as indicated by a
38
-      copyright notice that is included in or attached to the work
39
-      (an example is provided in the Appendix below).
40
-
41
-      "Derivative Works" shall mean any work, whether in Source or Object
42
-      form, that is based on (or derived from) the Work and for which the
43
-      editorial revisions, annotations, elaborations, or other modifications
44
-      represent, as a whole, an original work of authorship. For the purposes
45
-      of this License, Derivative Works shall not include works that remain
46
-      separable from, or merely link (or bind by name) to the interfaces of,
47
-      the Work and Derivative Works thereof.
48
-
49
-      "Contribution" shall mean any work of authorship, including
50
-      the original version of the Work and any modifications or additions
51
-      to that Work or Derivative Works thereof, that is intentionally
52
-      submitted to Licensor for inclusion in the Work by the copyright owner
53
-      or by an individual or Legal Entity authorized to submit on behalf of
54
-      the copyright owner. For the purposes of this definition, "submitted"
55
-      means any form of electronic, verbal, or written communication sent
56
-      to the Licensor or its representatives, including but not limited to
57
-      communication on electronic mailing lists, source code control systems,
58
-      and issue tracking systems that are managed by, or on behalf of, the
59
-      Licensor for the purpose of discussing and improving the Work, but
60
-      excluding communication that is conspicuously marked or otherwise
61
-      designated in writing by the copyright owner as "Not a Contribution."
62
-
63
-      "Contributor" shall mean Licensor and any individual or Legal Entity
64
-      on behalf of whom a Contribution has been received by Licensor and
65
-      subsequently incorporated within the Work.
66
-
67
-   2. Grant of Copyright License. Subject to the terms and conditions of
68
-      this License, each Contributor hereby grants to You a perpetual,
69
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
-      copyright license to reproduce, prepare Derivative Works of,
71
-      publicly display, publicly perform, sublicense, and distribute the
72
-      Work and such Derivative Works in Source or Object form.
73
-
74
-   3. Grant of Patent License. Subject to the terms and conditions of
75
-      this License, each Contributor hereby grants to You a perpetual,
76
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
-      (except as stated in this section) patent license to make, have made,
78
-      use, offer to sell, sell, import, and otherwise transfer the Work,
79
-      where such license applies only to those patent claims licensable
80
-      by such Contributor that are necessarily infringed by their
81
-      Contribution(s) alone or by combination of their Contribution(s)
82
-      with the Work to which such Contribution(s) was submitted. If You
83
-      institute patent litigation against any entity (including a
84
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
85
-      or a Contribution incorporated within the Work constitutes direct
86
-      or contributory patent infringement, then any patent licenses
87
-      granted to You under this License for that Work shall terminate
88
-      as of the date such litigation is filed.
89
-
90
-   4. Redistribution. You may reproduce and distribute copies of the
91
-      Work or Derivative Works thereof in any medium, with or without
92
-      modifications, and in Source or Object form, provided that You
93
-      meet the following conditions:
94
-
95
-      (a) You must give any other recipients of the Work or
96
-          Derivative Works a copy of this License; and
97
-
98
-      (b) You must cause any modified files to carry prominent notices
99
-          stating that You changed the files; and
100
-
101
-      (c) You must retain, in the Source form of any Derivative Works
102
-          that You distribute, all copyright, patent, trademark, and
103
-          attribution notices from the Source form of the Work,
104
-          excluding those notices that do not pertain to any part of
105
-          the Derivative Works; and
106
-
107
-      (d) If the Work includes a "NOTICE" text file as part of its
108
-          distribution, then any Derivative Works that You distribute must
109
-          include a readable copy of the attribution notices contained
110
-          within such NOTICE file, excluding those notices that do not
111
-          pertain to any part of the Derivative Works, in at least one
112
-          of the following places: within a NOTICE text file distributed
113
-          as part of the Derivative Works; within the Source form or
114
-          documentation, if provided along with the Derivative Works; or,
115
-          within a display generated by the Derivative Works, if and
116
-          wherever such third-party notices normally appear. The contents
117
-          of the NOTICE file are for informational purposes only and
118
-          do not modify the License. You may add Your own attribution
119
-          notices within Derivative Works that You distribute, alongside
120
-          or as an addendum to the NOTICE text from the Work, provided
121
-          that such additional attribution notices cannot be construed
122
-          as modifying the License.
123
-
124
-      You may add Your own copyright statement to Your modifications and
125
-      may provide additional or different license terms and conditions
126
-      for use, reproduction, or distribution of Your modifications, or
127
-      for any such Derivative Works as a whole, provided Your use,
128
-      reproduction, and distribution of the Work otherwise complies with
129
-      the conditions stated in this License.
130
-
131
-   5. Submission of Contributions. Unless You explicitly state otherwise,
132
-      any Contribution intentionally submitted for inclusion in the Work
133
-      by You to the Licensor shall be under the terms and conditions of
134
-      this License, without any additional terms or conditions.
135
-      Notwithstanding the above, nothing herein shall supersede or modify
136
-      the terms of any separate license agreement you may have executed
137
-      with Licensor regarding such Contributions.
138
-
139
-   6. Trademarks. This License does not grant permission to use the trade
140
-      names, trademarks, service marks, or product names of the Licensor,
141
-      except as required for reasonable and customary use in describing the
142
-      origin of the Work and reproducing the content of the NOTICE file.
143
-
144
-   7. Disclaimer of Warranty. Unless required by applicable law or
145
-      agreed to in writing, Licensor provides the Work (and each
146
-      Contributor provides its Contributions) on an "AS IS" BASIS,
147
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
-      implied, including, without limitation, any warranties or conditions
149
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
-      PARTICULAR PURPOSE. You are solely responsible for determining the
151
-      appropriateness of using or redistributing the Work and assume any
152
-      risks associated with Your exercise of permissions under this License.
153
-
154
-   8. Limitation of Liability. In no event and under no legal theory,
155
-      whether in tort (including negligence), contract, or otherwise,
156
-      unless required by applicable law (such as deliberate and grossly
157
-      negligent acts) or agreed to in writing, shall any Contributor be
158
-      liable to You for damages, including any direct, indirect, special,
159
-      incidental, or consequential damages of any character arising as a
160
-      result of this License or out of the use or inability to use the
161
-      Work (including but not limited to damages for loss of goodwill,
162
-      work stoppage, computer failure or malfunction, or any and all
163
-      other commercial damages or losses), even if such Contributor
164
-      has been advised of the possibility of such damages.
165
-
166
-   9. Accepting Warranty or Additional Liability. While redistributing
167
-      the Work or Derivative Works thereof, You may choose to offer,
168
-      and charge a fee for, acceptance of support, warranty, indemnity,
169
-      or other liability obligations and/or rights consistent with this
170
-      License. However, in accepting such obligations, You may act only
171
-      on Your own behalf and on Your sole responsibility, not on behalf
172
-      of any other Contributor, and only if You agree to indemnify,
173
-      defend, and hold each Contributor harmless for any liability
174
-      incurred by, or claims asserted against, such Contributor by reason
175
-      of your accepting any such warranty or additional liability.
176
-
177
-   END OF TERMS AND CONDITIONS
178
-
179
-   APPENDIX: How to apply the Apache License to your work.
180
-
181
-      To apply the Apache License to your work, attach the following
182
-      boilerplate notice, with the fields enclosed by brackets "[]"
183
-      replaced with your own identifying information. (Don't include
184
-      the brackets!)  The text should be enclosed in the appropriate
185
-      comment syntax for the file format. We also recommend that a
186
-      file or class name and description of purpose be included on the
187
-      same "printed page" as the copyright notice for easier
188
-      identification within third-party archives.
189
-
190
-   Copyright [yyyy] [name of copyright owner]
191
-
192
-   Licensed under the Apache License, Version 2.0 (the "License");
193
-   you may not use this file except in compliance with the License.
194
-   You may obtain a copy of the License at
195
-
196
-       http://www.apache.org/licenses/LICENSE-2.0
197
-
198
-   Unless required by applicable law or agreed to in writing, software
199
-   distributed under the License is distributed on an "AS IS" BASIS,
200
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
-   See the License for the specific language governing permissions and
202
-   limitations under the License.

+ 0
- 5
node_modules/cordova-plugin-file/NOTICE Datei anzeigen

@@ -1,5 +0,0 @@
1
-Apache Cordova
2
-Copyright 2012 The Apache Software Foundation
3
-
4
-This product includes software developed at
5
-The Apache Software Foundation (http://www.apache.org/).

+ 0
- 833
node_modules/cordova-plugin-file/README.md Datei anzeigen

@@ -1,833 +0,0 @@
1
----
2
-title: File
3
-description: Read/write files on the device.
4
----
5
-<!--
6
-# license: Licensed to the Apache Software Foundation (ASF) under one
7
-#         or more contributor license agreements.  See the NOTICE file
8
-#         distributed with this work for additional information
9
-#         regarding copyright ownership.  The ASF licenses this file
10
-#         to you under the Apache License, Version 2.0 (the
11
-#         "License"); you may not use this file except in compliance
12
-#         with the License.  You may obtain a copy of the License at
13
-#
14
-#           http://www.apache.org/licenses/LICENSE-2.0
15
-#
16
-#         Unless required by applicable law or agreed to in writing,
17
-#         software distributed under the License is distributed on an
18
-#         "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
19
-#         KIND, either express or implied.  See the License for the
20
-#         specific language governing permissions and limitations
21
-#         under the License.
22
--->
23
-
24
-|AppVeyor|Travis CI|
25
-|:-:|:-:|
26
-|[![Build status](https://ci.appveyor.com/api/projects/status/github/apache/cordova-plugin-file?branch=master)](https://ci.appveyor.com/project/ApacheSoftwareFoundation/cordova-plugin-file)|[![Build Status](https://travis-ci.org/apache/cordova-plugin-file.svg?branch=master)](https://travis-ci.org/apache/cordova-plugin-file)|
27
-
28
-# cordova-plugin-file
29
-
30
-This plugin implements a File API allowing read/write access to files residing on the device.
31
-
32
-This plugin is based on several specs, including :
33
-The HTML5 File API
34
-[http://www.w3.org/TR/FileAPI/](http://www.w3.org/TR/FileAPI/)
35
-
36
-The Directories and System extensions
37
-Latest:
38
-[http://www.w3.org/TR/2012/WD-file-system-api-20120417/](http://www.w3.org/TR/2012/WD-file-system-api-20120417/)
39
-Although most of the plugin code was written when an earlier spec was current:
40
-[http://www.w3.org/TR/2011/WD-file-system-api-20110419/](http://www.w3.org/TR/2011/WD-file-system-api-20110419/)
41
-
42
-It also implements the FileWriter spec :
43
-[http://dev.w3.org/2009/dap/file-system/file-writer.html](http://dev.w3.org/2009/dap/file-system/file-writer.html)
44
-
45
->*Note* While the W3C FileSystem spec is deprecated for web browsers, the FileSystem APIs are supported in Cordova applications with this plugin for the platforms listed in the _Supported Platforms_ list, with the exception of the Browser platform.
46
-
47
-To get a few ideas how to use the plugin, check out the [sample](#sample) at the bottom of this page. For additional examples (browser focused), see the HTML5 Rocks' [FileSystem article.](http://www.html5rocks.com/en/tutorials/file/filesystem/)
48
-
49
-For an overview of other storage options, refer to Cordova's
50
-[storage guide](http://cordova.apache.org/docs/en/latest/cordova/storage/storage.html).
51
-
52
-This plugin defines global `cordova.file` object.
53
-
54
-Although in the global scope, it is not available until after the `deviceready` event.
55
-
56
-    document.addEventListener("deviceready", onDeviceReady, false);
57
-    function onDeviceReady() {
58
-        console.log(cordova.file);
59
-    }
60
-
61
-## Installation
62
-
63
-    cordova plugin add cordova-plugin-file
64
-
65
-## Supported Platforms
66
-
67
-- Android
68
-- iOS
69
-- OS X
70
-- Windows*
71
-- Browser
72
-
73
-\* _These platforms do not support `FileReader.readAsArrayBuffer` nor `FileWriter.write(blob)`._
74
-
75
-## Where to Store Files
76
-
77
-As of v1.2.0, URLs to important file-system directories are provided.
78
-Each URL is in the form _file:///path/to/spot/_, and can be converted to a
79
-`DirectoryEntry` using `window.resolveLocalFileSystemURL()`.
80
-
81
-* `cordova.file.applicationDirectory` - Read-only directory where the application
82
-  is installed. (_iOS_, _Android_, _BlackBerry 10_, _OSX_, _windows_)
83
-
84
-* `cordova.file.applicationStorageDirectory` - Root directory of the application's
85
-  sandbox; on iOS & windows this location is read-only (but specific subdirectories [like
86
-  `/Documents` on iOS or `/localState` on windows] are read-write). All data contained within
87
-  is private to the app. (_iOS_, _Android_, _BlackBerry 10_, _OSX_)
88
-
89
-* `cordova.file.dataDirectory` - Persistent and private data storage within the
90
-  application's sandbox using internal memory (on Android, if you need to use
91
-  external memory, use `.externalDataDirectory`). On iOS, this directory is not
92
-  synced with iCloud (use `.syncedDataDirectory`). (_iOS_, _Android_, _BlackBerry 10_, _windows_)
93
-
94
-* `cordova.file.cacheDirectory` -  Directory for cached data files or any files
95
-  that your app can re-create easily. The OS may delete these files when the device
96
-  runs low on storage, nevertheless, apps should not rely on the OS to delete files
97
-  in here. (_iOS_, _Android_, _BlackBerry 10_, _OSX_, _windows_)
98
-
99
-* `cordova.file.externalApplicationStorageDirectory` - Application space on
100
-  external storage. (_Android_)
101
-
102
-* `cordova.file.externalDataDirectory` - Where to put app-specific data files on
103
-  external storage. (_Android_)
104
-
105
-* `cordova.file.externalCacheDirectory` - Application cache on external storage.
106
-  (_Android_)
107
-
108
-* `cordova.file.externalRootDirectory` - External storage (SD card) root. (_Android_, _BlackBerry 10_)
109
-
110
-* `cordova.file.tempDirectory` - Temp directory that the OS can clear at will. Do not
111
-  rely on the OS to clear this directory; your app should always remove files as
112
-  applicable. (_iOS_, _OSX_, _windows_)
113
-
114
-* `cordova.file.syncedDataDirectory` - Holds app-specific files that should be synced
115
-  (e.g. to iCloud). (_iOS_, _windows_)
116
-
117
-* `cordova.file.documentsDirectory` - Files private to the app, but that are meaningful
118
-  to other application (e.g. Office files). Note that for _OSX_ this is the user's `~/Documents` directory. (_iOS_, _OSX_)
119
-
120
-* `cordova.file.sharedDirectory` - Files globally available to all applications (_BlackBerry 10_)
121
-
122
-## File System Layouts
123
-
124
-Although technically an implementation detail, it can be very useful to know how
125
-the `cordova.file.*` properties map to physical paths on a real device.
126
-
127
-### iOS File System Layout
128
-
129
-| Device Path                                    | `cordova.file.*`            | `iosExtraFileSystems` | r/w? | persistent? | OS clears | sync | private |
130
-|:-----------------------------------------------|:----------------------------|:----------------------|:----:|:-----------:|:---------:|:----:|:-------:|
131
-| `/var/mobile/Applications/<UUID>/`             | applicationStorageDirectory | -                     | r    |     N/A     |     N/A   | N/A  |   Yes   |
132
-| &nbsp;&nbsp;&nbsp;`appname.app/`               | applicationDirectory        | bundle                | r    |     N/A     |     N/A   | N/A  |   Yes   |
133
-| &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`www/`     | -                           | -                     | r    |     N/A     |     N/A   | N/A  |   Yes   |
134
-| &nbsp;&nbsp;&nbsp;`Documents/`                 | documentsDirectory          | documents             | r/w  |     Yes     |     No    | Yes  |   Yes   |
135
-| &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`NoCloud/` | -                           | documents-nosync      | r/w  |     Yes     |     No    | No   |   Yes   |
136
-| &nbsp;&nbsp;&nbsp;`Library`                    | -                           | library               | r/w  |     Yes     |     No    | Yes? |   Yes   |
137
-| &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`NoCloud/` | dataDirectory               | library-nosync        | r/w  |     Yes     |     No    | No   |   Yes   |
138
-| &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`Cloud/`   | syncedDataDirectory         | -                     | r/w  |     Yes     |     No    | Yes  |   Yes   |
139
-| &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`Caches/`  | cacheDirectory              | cache                 | r/w  |     Yes*    |  Yes\*\*\*| No   |   Yes   |
140
-| &nbsp;&nbsp;&nbsp;`tmp/`                       | tempDirectory               | -                     | r/w  |     No\*\*  |  Yes\*\*\*| No   |   Yes   |
141
-
142
-
143
-  \* Files persist across app restarts and upgrades, but this directory can
144
-     be cleared whenever the OS desires. Your app should be able to recreate any
145
-     content that might be deleted.
146
-
147
-\*\* Files may persist across app restarts, but do not rely on this behavior. Files
148
-     are not guaranteed to persist across updates. Your app should remove files from
149
-     this directory when it is applicable, as the OS does not guarantee when (or even
150
-     if) these files are removed.
151
-
152
-\*\*\* The OS may clear the contents of this directory whenever it feels it is
153
-     necessary, but do not rely on this. You should clear this directory as
154
-     appropriate for your application.
155
-
156
-### Android File System Layout
157
-
158
-| Device Path                                     | `cordova.file.*`            | `AndroidExtraFileSystems` | r/w? | persistent? | OS clears | private |
159
-|:------------------------------------------------|:----------------------------|:--------------------------|:----:|:-----------:|:---------:|:-------:|
160
-| `file:///android_asset/`                        | applicationDirectory        | assets                    | r    |     N/A     |     N/A   |   Yes   |
161
-| `/data/data/<app-id>/`                          | applicationStorageDirectory | -                         | r/w  |     N/A     |     N/A   |   Yes   |
162
-| &nbsp;&nbsp;&nbsp;`cache`                       | cacheDirectory              | cache                     | r/w  |     Yes     |     Yes\* |   Yes   |
163
-| &nbsp;&nbsp;&nbsp;`files`                       | dataDirectory               | files                     | r/w  |     Yes     |     No    |   Yes   |
164
-| &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`Documents` |                             | documents                 | r/w  |     Yes     |     No    |   Yes   |
165
-| `<sdcard>/`                                     | externalRootDirectory       | sdcard                    | r/w  |     Yes     |     No    |   No    |
166
-| &nbsp;&nbsp;&nbsp;`Android/data/<app-id>/`      | externalApplicationStorageDirectory | -                 | r/w  |     Yes     |     No    |   No    |
167
-| &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`cache`     | externalCacheDirectory       | cache-external            | r/w  |     Yes     |     No\*\*|   No    |
168
-| &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`files`     | externalDataDirectory       | files-external            | r/w  |     Yes     |     No    |   No    |
169
-
170
-\* The OS may periodically clear this directory, but do not rely on this behavior. Clear
171
-   the contents of this directory as appropriate for your application. Should a user
172
-   purge the cache manually, the contents of this directory are removed.
173
-
174
-\*\* The OS does not clear this directory automatically; you are responsible for managing
175
-     the contents yourself. Should the user purge the cache manually, the contents of the
176
-     directory are removed.
177
-
178
-**Note**: If external storage can't be mounted, the `cordova.file.external*`
179
-properties are `null`.
180
-
181
-### OS X File System Layout
182
-
183
-| Device Path                                      | `cordova.file.*`            | `iosExtraFileSystems` | r/w? |  OS clears | private |
184
-|:-------------------------------------------------|:----------------------------|:----------------------|:----:|:---------:|:-------:|
185
-| `/Applications/<appname>.app/`                   | -                           | bundle                | r    |     N/A   |   Yes   |
186
-| &nbsp;&nbsp;&nbsp;&nbsp;`Content/Resources/`     | applicationDirectory        | -                     | r    |     N/A   |   Yes   |
187
-| `~/Library/Application Support/<bundle-id>/`     | applicationStorageDirectory | -                     | r/w  |     No    |   Yes   |
188
-| &nbsp;&nbsp;&nbsp;&nbsp;`files/`                 | dataDirectory               | -                     | r/w  |     No    |   Yes   |
189
-| `~/Documents/`                                   | documentsDirectory          | documents             | r/w  |     No    |    No   |
190
-| `~/Library/Caches/<bundle-id>/`                  | cacheDirectory              | cache                 | r/w  |     No    |   Yes   |
191
-| `/tmp/`                                          | tempDirectory               | -                     | r/w  |    Yes\*  |   Yes   |
192
-| `/`                                              | rootDirectory               | root                  | r/w  |    No\*\* |    No   |
193
-
194
-**Note**: This is the layout for non sandboxed applications. I you enable sandboxing, the `applicationStorageDirectory` will be below ` ~/Library/Containers/<bundle-id>/Data/Library/Application Support`.
195
-
196
-\* Files persist across app restarts and upgrades, but this directory can
197
-     be cleared whenever the OS desires. Your app should be able to recreate any
198
-     content that might be deleted. You should clear this directory as
199
-     appropriate for your application.
200
-
201
-\*\* Allows access to the entire file system. This is only available for non sandboxed apps.
202
-
203
-### Windows File System Layout
204
-
205
-| Device Path                                           | `cordova.file.*`            | r/w? | persistent? | OS clears | private |
206
-|:------------------------------------------------------|:----------------------------|:----:|:-----------:|:---------:|:-------:|
207
-| `ms-appdata:///`                                      | applicationDirectory        | r    |     N/A     |     N/A   |   Yes   |
208
-| &nbsp;&nbsp;&nbsp;`local/`                            | dataDirectory               | r/w  |     Yes     |     No    |   Yes   |
209
-| &nbsp;&nbsp;&nbsp;`temp/`                             | cacheDirectory              | r/w  |     No      |     Yes\* |   Yes   |
210
-| &nbsp;&nbsp;&nbsp;`temp/`                             | tempDirectory               | r/w  |     No      |     Yes\* |   Yes   |
211
-| &nbsp;&nbsp;&nbsp;`roaming/`                          | syncedDataDirectory         | r/w  |     Yes     |     No    |   Yes   |
212
-
213
-\* The OS may periodically clear this directory
214
-
215
-
216
-## Android Quirks
217
-
218
-### Android Persistent storage location
219
-
220
-There are multiple valid locations to store persistent files on an Android
221
-device. See [this page](http://developer.android.com/guide/topics/data/data-storage.html)
222
-for an extensive discussion of the various possibilities.
223
-
224
-Previous versions of the plugin would choose the location of the temporary and
225
-persistent files on startup, based on whether the device claimed that the SD
226
-Card (or equivalent storage partition) was mounted. If the SD Card was mounted,
227
-or if a large internal storage partition was available (such as on Nexus
228
-devices,) then the persistent files would be stored in the root of that space.
229
-This meant that all Cordova apps could see all of the files available on the
230
-card.
231
-
232
-If the SD card was not available, then previous versions would store data under
233
-`/data/data/<packageId>`, which isolates apps from each other, but may still
234
-cause data to be shared between users.
235
-
236
-It is now possible to choose whether to store files in the internal file
237
-storage location, or using the previous logic, with a preference in your
238
-application's `config.xml` file. To do this, add one of these two lines to
239
-`config.xml`:
240
-
241
-    <preference name="AndroidPersistentFileLocation" value="Internal" />
242
-
243
-    <preference name="AndroidPersistentFileLocation" value="Compatibility" />
244
-
245
-Without this line, the File plugin will use `Internal` as the default. If
246
-a preference tag is present, and is not one of these values, the application
247
-will not start.
248
-
249
-If your application has previously been shipped to users, using an older (pre-
250
-3.0.0) version of this plugin, and has stored files in the persistent filesystem,
251
-then you should set the preference to `Compatibility` if your config.xml does not specify a location for the persistent filesystem. Switching the location to
252
-"Internal" would mean that existing users who upgrade their application may be
253
-unable to access their previously-stored files, depending on their device.
254
-
255
-If your application is new, or has never previously stored files in the
256
-persistent filesystem, then the `Internal` setting is generally recommended.
257
-
258
-### Slow recursive operations for /android_asset
259
-
260
-Listing asset directories is really slow on Android. You can speed it up though, by
261
-adding `src/android/build-extras.gradle` to the root of your android project (also
262
-requires cordova-android@4.0.0 or greater).
263
-
264
-### Permisson to write to external storage when it's not mounted on Marshmallow
265
-
266
-Marshmallow requires the apps to ask for permissions when reading/writing to external locations. By
267
-[default](http://developer.android.com/guide/topics/data/data-storage.html#filesExternal), your app has permission to write to
268
-`cordova.file.applicationStorageDirectory` and `cordova.file.externalApplicationStorageDirectory`, and the plugin doesn't request permission
269
-for these two directories unless external storage is not mounted. However due to a limitation, when external storage is not mounted, it would ask for
270
-permission to write to `cordova.file.externalApplicationStorageDirectory`.
271
-
272
-## iOS Quirks
273
-
274
-- `cordova.file.applicationStorageDirectory` is read-only; attempting to store
275
-  files within the root directory will fail. Use one of the other `cordova.file.*`
276
-  properties defined for iOS (only `applicationDirectory` and `applicationStorageDirectory` are
277
-  read-only).
278
-- `FileReader.readAsText(blob, encoding)`
279
-  - The `encoding` parameter is not supported, and UTF-8 encoding is always in effect.
280
-
281
-### iOS Persistent storage location
282
-
283
-There are two valid locations to store persistent files on an iOS device: the
284
-Documents directory and the Library directory. Previous versions of the plugin
285
-only ever stored persistent files in the Documents directory. This had the
286
-side-effect of making all of an application's files visible in iTunes, which
287
-was often unintended, especially for applications which handle lots of small
288
-files, rather than producing complete documents for export, which is the
289
-intended purpose of the directory.
290
-
291
-It is now possible to choose whether to store files in the documents or library
292
-directory, with a preference in your application's `config.xml` file. To do this,
293
-add one of these two lines to `config.xml`:
294
-
295
-    <preference name="iosPersistentFileLocation" value="Library" />
296
-
297
-    <preference name="iosPersistentFileLocation" value="Compatibility" />
298
-
299
-Without this line, the File plugin will use `Compatibility` as the default. If
300
-a preference tag is present, and is not one of these values, the application
301
-will not start.
302
-
303
-If your application has previously been shipped to users, using an older (pre-
304
-1.0) version of this plugin, and has stored files in the persistent filesystem,
305
-then you should set the preference to `Compatibility`. Switching the location to
306
-`Library` would mean that existing users who upgrade their application would be
307
-unable to access their previously-stored files.
308
-
309
-If your application is new, or has never previously stored files in the
310
-persistent filesystem, then the `Library` setting is generally recommended.
311
-
312
-## Browser Quirks
313
-
314
-### Common quirks and remarks
315
-- Each browser uses its own sandboxed filesystem. IE and Firefox use IndexedDB as a base.
316
-All browsers use forward slash as directory separator in a path.
317
-- Directory entries have to be created successively.
318
-For example, the call `fs.root.getDirectory('dir1/dir2', {create:true}, successCallback, errorCallback)`
319
-will fail if dir1 did not exist.
320
-- The plugin requests user permission to use persistent storage at the application first start.
321
-- Plugin supports `cdvfile://localhost` (local resources) only. I.e. external resources are not supported via `cdvfile`.
322
-- The plugin does not follow ["File System API 8.3 Naming restrictions"](http://www.w3.org/TR/2011/WD-file-system-api-20110419/#naming-restrictions).
323
-- Blob and File' `close` function is not supported.
324
-- `FileSaver` and `BlobBuilder` are not supported by this plugin and don't have stubs.
325
-- The plugin does not support `requestAllFileSystems`. This function is also missing in the specifications.
326
-- Entries in directory will not be removed if you use `create: true` flag for existing directory.
327
-- Files created via constructor are not supported. You should use entry.file method instead.
328
-- Each browser uses its own form for blob URL references.
329
-- `readAsDataURL` function is supported, but the mediatype in Chrome depends on entry name extension,
330
-mediatype in IE is always empty (which is the same as `text-plain` according the specification),
331
-the mediatype in Firefox is always `application/octet-stream`.
332
-For example, if the content is `abcdefg` then Firefox returns `data:application/octet-stream;base64,YWJjZGVmZw==`,
333
-IE returns `data:;base64,YWJjZGVmZw==`, Chrome returns `data:<mediatype depending on extension of entry name>;base64,YWJjZGVmZw==`.
334
-- `toInternalURL` returns the path in the form `file:///persistent/path/to/entry` (Firefox, IE).
335
-Chrome returns the path in the form `cdvfile://localhost/persistent/file`.
336
-
337
-### Chrome quirks
338
-- Chrome filesystem is not immediately ready after device ready event. As a workaround you can subscribe to `filePluginIsReady` event.
339
-Example:
340
-```javascript
341
-window.addEventListener('filePluginIsReady', function(){ console.log('File plugin is ready');}, false);
342
-```
343
-You can use `window.isFilePluginReadyRaised` function to check whether event was already raised.
344
-- window.requestFileSystem TEMPORARY and PERSISTENT filesystem quotas are not limited in Chrome.
345
-- To increase persistent storage in Chrome you need to call `window.initPersistentFileSystem` method. Persistent storage quota is 5 MB by default.
346
-- Chrome requires `--allow-file-access-from-files` run argument to support API via `file:///` protocol.
347
-- `File` object will be not changed if you use flag `{create:true}` when getting an existing `Entry`.
348
-- events `cancelable` property is set to true in Chrome. This is contrary to the [specification](http://dev.w3.org/2009/dap/file-system/file-writer.html).
349
-- `toURL` function in Chrome returns `filesystem:`-prefixed path depending on application host.
350
-For example, `filesystem:file:///persistent/somefile.txt`, `filesystem:http://localhost:8080/persistent/somefile.txt`.
351
-- `toURL` function result does not contain trailing slash in case of directory entry.
352
-Chrome resolves directories with slash-trailed urls correctly though.
353
-- `resolveLocalFileSystemURL` method requires the inbound `url` to have `filesystem` prefix. For example, `url` parameter for `resolveLocalFileSystemURL`
354
-should be in the form `filesystem:file:///persistent/somefile.txt` as opposed to the form `file:///persistent/somefile.txt` in Android.
355
-- Deprecated `toNativeURL` function is not supported and does not have a stub.
356
-- `setMetadata` function is not stated in the specifications and not supported.
357
-- INVALID_MODIFICATION_ERR (code: 9) is thrown instead of SYNTAX_ERR(code: 8) on requesting of a non-existant filesystem.
358
-- INVALID_MODIFICATION_ERR (code: 9) is thrown instead of PATH_EXISTS_ERR(code: 12) on trying to exclusively create a file or directory, which already exists.
359
-- INVALID_MODIFICATION_ERR (code: 9) is thrown instead of  NO_MODIFICATION_ALLOWED_ERR(code: 6) on trying to call removeRecursively on the root file system.
360
-- INVALID_MODIFICATION_ERR (code: 9) is thrown instead of NOT_FOUND_ERR(code: 1) on trying to moveTo directory that does not exist.
361
-
362
-### IndexedDB-based impl quirks (Firefox and IE)
363
-- `.` and `..` are not supported.
364
-- IE does not support `file:///`-mode; only hosted mode is supported (http://localhost:xxxx).
365
-- Firefox filesystem size is not limited but each 50MB extension will request a user permission.
366
-IE10 allows up to 10mb of combined AppCache and IndexedDB used in implementation of filesystem without prompting,
367
-once you hit that level you will be asked if you want to allow it to be increased up to a max of 250mb per site.
368
-So `size` parameter for `requestFileSystem` function does not affect filesystem in Firefox and IE.
369
-- `readAsBinaryString` function is not stated in the Specs and not supported in IE and does not have a stub.
370
-- `file.type` is always null.
371
-- You should not create entry using DirectoryEntry instance callback result which was deleted.
372
-Otherwise, you will get a 'hanging entry'.
373
-- Before you can read a file, which was just written you need to get a new instance of this file.
374
-- `setMetadata` function, which is not stated in the Specs supports `modificationTime` field change only.
375
-- `copyTo` and `moveTo` functions do not support directories.
376
-- Directories metadata is not supported.
377
-- Both Entry.remove and directoryEntry.removeRecursively don't fail when removing
378
-non-empty directories - directories being removed are cleaned along with contents instead.
379
-- `abort` and `truncate` functions are not supported.
380
-- progress events are not fired. For example, this handler will be not executed:
381
-```javascript
382
-writer.onprogress = function() { /*commands*/ };
383
-```
384
-
385
-## Upgrading Notes
386
-
387
-In v1.0.0 of this plugin, the `FileEntry` and `DirectoryEntry` structures have changed,
388
-to be more in line with the published specification.
389
-
390
-Previous (pre-1.0.0) versions of the plugin stored the device-absolute-file-location
391
-in the `fullPath` property of `Entry` objects. These paths would typically look like
392
-
393
-    /var/mobile/Applications/<application UUID>/Documents/path/to/file  (iOS)
394
-    /storage/emulated/0/path/to/file                                    (Android)
395
-
396
-These paths were also returned by the `toURL()` method of the `Entry` objects.
397
-
398
-With v1.0.0, the `fullPath` attribute is the path to the file, _relative to the root of
399
-the HTML filesystem_. So, the above paths would now both be represented by a `FileEntry`
400
-object with a `fullPath` of
401
-
402
-    /path/to/file
403
-
404
-If your application works with device-absolute-paths, and you previously retrieved those
405
-paths through the `fullPath` property of `Entry` objects, then you should update your code
406
-to use `entry.toURL()` instead.
407
-
408
-For backwards compatibility, the `resolveLocalFileSystemURL()` method will accept a
409
-device-absolute-path, and will return an `Entry` object corresponding to it, as long as that
410
-file exists within either the `TEMPORARY` or `PERSISTENT` filesystems.
411
-
412
-This has particularly been an issue with the File-Transfer plugin, which previously used
413
-device-absolute-paths (and can still accept them). It has been updated to work correctly
414
-with FileSystem URLs, so replacing `entry.fullPath` with `entry.toURL()` should resolve any
415
-issues getting that plugin to work with files on the device.
416
-
417
-In v1.1.0 the return value of `toURL()` was changed (see [CB-6394](https://issues.apache.org/jira/browse/CB-6394))
418
-to return an absolute 'file://' URL. wherever possible. To ensure a 'cdvfile:'-URL you can use `toInternalURL()` now.
419
-This method will now return filesystem URLs of the form
420
-
421
-    cdvfile://localhost/persistent/path/to/file
422
-
423
-which can be used to identify the file uniquely.
424
-
425
-## cdvfile protocol
426
-**Purpose**
427
-
428
-`cdvfile://localhost/persistent|temporary|another-fs-root*/path/to/file` can be used for platform-independent file paths.
429
-cdvfile paths are supported by core plugins - for example you can download an mp3 file to cdvfile-path via `cordova-plugin-file-transfer` and play it via `cordova-plugin-media`.
430
-
431
-__*Note__: See [Where to Store Files](#where-to-store-files), [File System Layouts](#file-system-layouts) and [Configuring the Plugin](#configuring-the-plugin-optional) for more details about available fs roots.
432
-
433
-To use `cdvfile` as a tag' `src` you can convert it to native path via `toURL()` method of the resolved fileEntry, which you can get via `resolveLocalFileSystemURL` - see examples below.
434
-
435
-You can also use `cdvfile://` paths directly in the DOM, for example:
436
-```HTML
437
-<img src="cdvfile://localhost/persistent/img/logo.png" />
438
-```
439
-
440
-__Note__: This method requires following Content Security rules updates:
441
-* Add `cdvfile:` scheme to `Content-Security-Policy` meta tag of the index page, e.g.:
442
-  - `<meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: `**cdvfile:**` https://ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *">`
443
-* Add `<access origin="cdvfile://*" />` to `config.xml`.
444
-
445
-**Converting cdvfile:// to native path**
446
-
447
-```javascript
448
-resolveLocalFileSystemURL('cdvfile://localhost/temporary/path/to/file.mp4', function(entry) {
449
-    var nativePath = entry.toURL();
450
-    console.log('Native URI: ' + nativePath);
451
-    document.getElementById('video').src = nativePath;
452
-```
453
-
454
-**Converting native path to cdvfile://**
455
-
456
-```javascript
457
-resolveLocalFileSystemURL(nativePath, function(entry) {
458
-    console.log('cdvfile URI: ' + entry.toInternalURL());
459
-```
460
-
461
-**Using cdvfile in core plugins**
462
-
463
-```javascript
464
-fileTransfer.download(uri, 'cdvfile://localhost/temporary/path/to/file.mp3', function (entry) { ...
465
-```
466
-```javascript
467
-var my_media = new Media('cdvfile://localhost/temporary/path/to/file.mp3', ...);
468
-my_media.play();
469
-```
470
-
471
-#### cdvfile quirks
472
-- Using `cdvfile://` paths in the DOM is not supported on Windows platform (a path can be converted to native instead).
473
-
474
-
475
-## List of Error Codes and Meanings
476
-When an error is thrown, one of the following codes will be used.
477
-
478
-| Code | Constant                      |
479
-|-----:|:------------------------------|
480
-|    1 | `NOT_FOUND_ERR`               |
481
-|    2 | `SECURITY_ERR`                |
482
-|    3 | `ABORT_ERR`                   |
483
-|    4 | `NOT_READABLE_ERR`            |
484
-|    5 | `ENCODING_ERR`                |
485
-|    6 | `NO_MODIFICATION_ALLOWED_ERR` |
486
-|    7 | `INVALID_STATE_ERR`           |
487
-|    8 | `SYNTAX_ERR`                  |
488
-|    9 | `INVALID_MODIFICATION_ERR`    |
489
-|   10 | `QUOTA_EXCEEDED_ERR`          |
490
-|   11 | `TYPE_MISMATCH_ERR`           |
491
-|   12 | `PATH_EXISTS_ERR`             |
492
-
493
-## Configuring the Plugin (Optional)
494
-
495
-The set of available filesystems can be configured per-platform. Both iOS and
496
-Android recognize a <preference> tag in `config.xml` which names the
497
-filesystems to be installed. By default, all file-system roots are enabled.
498
-
499
-    <preference name="iosExtraFilesystems" value="library,library-nosync,documents,documents-nosync,cache,bundle,root" />
500
-    <preference name="AndroidExtraFilesystems" value="files,files-external,documents,sdcard,cache,cache-external,assets,root" />
501
-
502
-### Android
503
-
504
-* `files`: The application's internal file storage directory
505
-* `files-external`: The application's external file storage directory
506
-* `sdcard`: The global external file storage directory (this is the root of the SD card, if one is installed). You must have the `android.permission.WRITE_EXTERNAL_STORAGE` permission to use this.
507
-* `cache`: The application's internal cache directory
508
-* `cache-external`: The application's external cache directory
509
-* `assets`: The application's bundle (read-only)
510
-* `root`: The entire device filesystem
511
-* `applicationDirectory`: ReadOnly with restricted access. Copying files in this directory is possible, but reading it directly results in 'file not found'.
512
-Android also supports a special filesystem named "documents", which represents a "/Documents/" subdirectory within the "files" filesystem.
513
-
514
-### iOS
515
-
516
-* `library`: The application's Library directory
517
-* `documents`: The application's Documents directory
518
-* `cache`: The application's Cache directory
519
-* `bundle`: The application's bundle; the location of the app itself on disk (read-only)
520
-* `root`: The entire device filesystem
521
-
522
-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.
523
-
524
-## Sample: Create Files and Directories, Write, Read, and Append files <a name="sample"></a>
525
-
526
-The File plugin allows you to do things like store files in a temporary or persistent storage location for your app (sandboxed storage) and to store files in other platform-dependent locations. The code snippets in this section demonstrate different tasks including:
527
-* [Accessing the file system](#persistent)
528
-* Using cross-platform Cordova file URLs to [store your files](#appendFile) (see _Where to Store Files_ for more info)
529
-* Creating [files](#persistent) and [directories](#createDir)
530
-* [Writing to files](#writeFile)
531
-* [Reading files](#readFile)
532
-* [Appending files](#appendFile)
533
-* [Display an image file](#displayImage)
534
-
535
-## Create a persistent file <a name="persistent"></a>
536
-
537
-Before you use the File plugin APIs, you can get access to the file system using `requestFileSystem`. When you do this, you can request either persistent or temporary storage. Persistent storage will not be removed unless permission is granted by the user.
538
-
539
-When you get file system access using `requestFileSystem`, access is granted for the sandboxed file system only (the sandbox limits access to the app itself), not for general access to any file system location on the device. (To access file system locations outside the sandboxed storage, use other methods such as window.resolveLocalFileSystemURL, which support platform-specific locations. For one example of this, see _Append a File_.)
540
-
541
-Here is a request for persistent storage.
542
-
543
->*Note* When targeting WebView clients (instead of a browser) or native apps (Windows), you dont need to use `requestQuota` before using persistent storage.
544
-
545
-```js
546
-window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function (fs) {
547
-
548
-    console.log('file system open: ' + fs.name);
549
-    fs.root.getFile("newPersistentFile.txt", { create: true, exclusive: false }, function (fileEntry) {
550
-
551
-        console.log("fileEntry is file?" + fileEntry.isFile.toString());
552
-        // fileEntry.name == 'someFile.txt'
553
-        // fileEntry.fullPath == '/someFile.txt'
554
-        writeFile(fileEntry, null);
555
-
556
-    }, onErrorCreateFile);
557
-
558
-}, onErrorLoadFs);
559
-```
560
-
561
-The success callback receives FileSystem object (fs). Use `fs.root` to return a DirectoryEntry object, which you can use to create or get a file (by calling `getFile`). In this example, `fs.root` is a DirectoryEntry object that represents the persistent storage in the sandboxed file system.
562
-
563
-The success callback for `getFile` receives a FileEntry object. You can use this to perform file write and file read operations.
564
-
565
-## Create a temporary file
566
-
567
-Here is an example of a request for temporary storage. Temporary storage may be deleted by the operating system if the device runs low on memory.
568
-
569
-```js
570
-window.requestFileSystem(window.TEMPORARY, 5 * 1024 * 1024, function (fs) {
571
-
572
-    console.log('file system open: ' + fs.name);
573
-    createFile(fs.root, "newTempFile.txt", false);
574
-
575
-}, onErrorLoadFs);
576
-```
577
-When you are using temporary storage, you can create or get the file by calling `getFile`. As in the persistent storage example, this will give you a FileEntry object that you can use for read or write operations.
578
-
579
-```js
580
-function createFile(dirEntry, fileName, isAppend) {
581
-    // Creates a new file or returns the file if it already exists.
582
-    dirEntry.getFile(fileName, {create: true, exclusive: false}, function(fileEntry) {
583
-
584
-        writeFile(fileEntry, null, isAppend);
585
-
586
-    }, onErrorCreateFile);
587
-
588
-}
589
-```
590
-
591
-## Write to a file <a name="writeFile"></a>
592
-
593
-Once you have a FileEntry object, you can write to the file by calling `createWriter`, which returns a FileWriter object in the success callback. Call the `write` method of FileWriter to write to the file.
594
-
595
-```js
596
-function writeFile(fileEntry, dataObj) {
597
-    // Create a FileWriter object for our FileEntry (log.txt).
598
-    fileEntry.createWriter(function (fileWriter) {
599
-
600
-        fileWriter.onwriteend = function() {
601
-            console.log("Successful file write...");
602
-            readFile(fileEntry);
603
-        };
604
-
605
-        fileWriter.onerror = function (e) {
606
-            console.log("Failed file write: " + e.toString());
607
-        };
608
-
609
-        // If data object is not passed in,
610
-        // create a new Blob instead.
611
-        if (!dataObj) {
612
-            dataObj = new Blob(['some file data'], { type: 'text/plain' });
613
-        }
614
-
615
-        fileWriter.write(dataObj);
616
-    });
617
-}
618
-```
619
-
620
-## Read a file <a name="readFile"></a>
621
-
622
-You also need a FileEntry object to read an existing file. Use the file property of FileEntry to get the file reference, and then create a new FileReader object. You can use methods like `readAsText` to start the read operation. When the read operation is complete, `this.result` stores the result of the read operation.
623
-
624
-```js
625
-function readFile(fileEntry) {
626
-
627
-    fileEntry.file(function (file) {
628
-        var reader = new FileReader();
629
-
630
-        reader.onloadend = function() {
631
-            console.log("Successful file read: " + this.result);
632
-            displayFileData(fileEntry.fullPath + ": " + this.result);
633
-        };
634
-
635
-        reader.readAsText(file);
636
-
637
-    }, onErrorReadFile);
638
-}
639
-```
640
-
641
-## Append a file using alternative methods <a name="appendFile"></a>
642
-
643
-Of course, you will often want to append existing files instead of creating new ones. Here is an example of that. This example shows another way that you can access the file system using window.resolveLocalFileSystemURL. In this example, pass the cross-platform Cordova file URL, cordova.file.dataDirectory, to the function. The success callback receives a DirectoryEntry object, which you can use to do things like create a file.
644
-
645
-```js
646
-window.resolveLocalFileSystemURL(cordova.file.dataDirectory, function (dirEntry) {
647
-    console.log('file system open: ' + dirEntry.name);
648
-    var isAppend = true;
649
-    createFile(dirEntry, "fileToAppend.txt", isAppend);
650
-}, onErrorLoadFs);
651
-```
652
-
653
-In addition to this usage, you can use `resolveLocalFileSystemURL` to get access to some file system locations that are not part of the sandboxed storage system. See _Where to store Files_ for more information; many of these storage locations are platform-specific. You can also pass cross-platform file system locations to `resolveLocalFileSystemURL` using the _cdvfile protocol_.
654
-
655
-For the append operation, there is nothing new in the `createFile` function that is called in the preceding code (see the preceding examples for the actual code). `createFile` calls `writeFile`. In `writeFile`, you check whether an append operation is requested.
656
-
657
-Once you have a FileWriter object, call the `seek` method, and pass in the index value for the position where you want to write. In this example, you also test whether the file exists. After calling seek, then call the write method of FileWriter.
658
-
659
-```js
660
-function writeFile(fileEntry, dataObj, isAppend) {
661
-    // Create a FileWriter object for our FileEntry (log.txt).
662
-    fileEntry.createWriter(function (fileWriter) {
663
-
664
-        fileWriter.onwriteend = function() {
665
-            console.log("Successful file read...");
666
-            readFile(fileEntry);
667
-        };
668
-
669
-        fileWriter.onerror = function (e) {
670
-            console.log("Failed file read: " + e.toString());
671
-        };
672
-
673
-        // If we are appending data to file, go to the end of the file.
674
-        if (isAppend) {
675
-            try {
676
-                fileWriter.seek(fileWriter.length);
677
-            }
678
-            catch (e) {
679
-                console.log("file doesn't exist!");
680
-            }
681
-        }
682
-        fileWriter.write(dataObj);
683
-    });
684
-}
685
-```
686
-
687
-## Store an existing binary file <a name="binaryFile"></a>
688
-
689
-We already showed how to write to a file that you just created in the sandboxed file system. What if you need to get access to an existing file and convert that to something you can store on your device? In this example, you obtain a file using an xhr request, and then save it to the cache in the sandboxed file system.
690
-
691
-Before you get the file, get a FileSystem reference using `requestFileSystem`. By passing window.TEMPORARY in the method call (same as before), the returned FileSystem object (fs) represents the cache in the sandboxed file system. Use `fs.root` to get the DirectoryEntry object that you need.
692
-
693
-```js
694
-window.requestFileSystem(window.TEMPORARY, 5 * 1024 * 1024, function (fs) {
695
-
696
-    console.log('file system open: ' + fs.name);
697
-    getSampleFile(fs.root);
698
-
699
-}, onErrorLoadFs);
700
-```
701
-
702
-For completeness, here is the xhr request to get a Blob image. There is nothing Cordova-specific in this code, except that you forward the DirectoryEntry reference that you already obtained as an argument to the saveFile function. You will save the blob image and display it later after reading the file (to validate the operation).
703
-
704
-```js
705
-function getSampleFile(dirEntry) {
706
-
707
-    var xhr = new XMLHttpRequest();
708
-    xhr.open('GET', 'http://cordova.apache.org/static/img/cordova_bot.png', true);
709
-    xhr.responseType = 'blob';
710
-
711
-    xhr.onload = function() {
712
-        if (this.status == 200) {
713
-
714
-            var blob = new Blob([this.response], { type: 'image/png' });
715
-            saveFile(dirEntry, blob, "downloadedImage.png");
716
-        }
717
-    };
718
-    xhr.send();
719
-}
720
-```
721
->*Note* For Cordova 5 security, the preceding code requires that you add the domain name, http://cordova.apache.org, to the Content-Security-Policy <meta> element in index.html.
722
-
723
-After getting the file, copy the contents to a new file. The current DirectoryEntry object is already associated with the app cache.
724
-
725
-```js
726
-function saveFile(dirEntry, fileData, fileName) {
727
-
728
-    dirEntry.getFile(fileName, { create: true, exclusive: false }, function (fileEntry) {
729
-
730
-        writeFile(fileEntry, fileData);
731
-
732
-    }, onErrorCreateFile);
733
-}
734
-```
735
-
736
-In writeFile, you pass in the Blob object as the dataObj and you will save that in the new file.
737
-
738
-```js
739
-function writeFile(fileEntry, dataObj, isAppend) {
740
-
741
-    // Create a FileWriter object for our FileEntry (log.txt).
742
-    fileEntry.createWriter(function (fileWriter) {
743
-
744
-        fileWriter.onwriteend = function() {
745
-            console.log("Successful file write...");
746
-            if (dataObj.type == "image/png") {
747
-                readBinaryFile(fileEntry);
748
-            }
749
-            else {
750
-                readFile(fileEntry);
751
-            }
752
-        };
753
-
754
-        fileWriter.onerror = function(e) {
755
-            console.log("Failed file write: " + e.toString());
756
-        };
757
-
758
-        fileWriter.write(dataObj);
759
-    });
760
-}
761
-```
762
-
763
-After writing to the file, read it and display it. You saved the image as binary data, so you can read it using FileReader.readAsArrayBuffer.
764
-
765
-```js
766
-function readBinaryFile(fileEntry) {
767
-
768
-    fileEntry.file(function (file) {
769
-        var reader = new FileReader();
770
-
771
-        reader.onloadend = function() {
772
-
773
-            console.log("Successful file write: " + this.result);
774
-            displayFileData(fileEntry.fullPath + ": " + this.result);
775
-
776
-            var blob = new Blob([new Uint8Array(this.result)], { type: "image/png" });
777
-            displayImage(blob);
778
-        };
779
-
780
-        reader.readAsArrayBuffer(file);
781
-
782
-    }, onErrorReadFile);
783
-}
784
-```
785
-
786
-After reading the data, you can display the image using code like this. Use window.URL.createObjectURL to get a DOM string for the Blob image.
787
-
788
-```js
789
-function displayImage(blob) {
790
-
791
-    // Displays image if result is a valid DOM string for an image.
792
-    var elem = document.getElementById('imageFile');
793
-    // Note: Use window.URL.revokeObjectURL when finished with image.
794
-    elem.src = window.URL.createObjectURL(blob);
795
-}
796
-```
797
-
798
-## Display an image file <a name="displayImage"></a>
799
-
800
-To display an image using a FileEntry, you can call the `toURL` method.
801
-
802
-```js
803
-function displayImageByFileURL(fileEntry) {
804
-    var elem = document.getElementById('imageFile');
805
-    elem.src = fileEntry.toURL();
806
-}
807
-```
808
-
809
-If you are using some platform-specific URIs instead of a FileEntry and you want to display an image, you may need to include the main part of the URI in the Content-Security-Policy <meta> element in index.html. For example, on Windows 10, you can include `ms-appdata:` in your <meta> element. Here is an example.
810
-
811
-```html
812
-<meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: ms-appdata: https://ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *">
813
-```
814
-
815
-## Create Directories <a name="createDir"></a>
816
-
817
-In the code here, you create directories in the root of the app storage location. You could use this code with any writable storage location (that is, any DirectoryEntry). Here, you write to the application cache (assuming that you used window.TEMPORARY to get your FileSystem object) by passing fs.root into this function.
818
-
819
-This code creates the /NewDirInRoot/images folder in the application cache. For platform-specific values, look at _File System Layouts_.
820
-
821
-```js
822
-function createDirectory(rootDirEntry) {
823
-    rootDirEntry.getDirectory('NewDirInRoot', { create: true }, function (dirEntry) {
824
-        dirEntry.getDirectory('images', { create: true }, function (subDirEntry) {
825
-
826
-            createFile(subDirEntry, "fileInNewSubDir.txt");
827
-
828
-        }, onErrorGetDir);
829
-    }, onErrorGetDir);
830
-}
831
-```
832
-
833
-When creating subfolders, you need to create each folder separately as shown in the preceding code.

+ 0
- 496
node_modules/cordova-plugin-file/RELEASENOTES.md Datei anzeigen

@@ -1,496 +0,0 @@
1
-<!--
2
-#
3
-# Licensed to the Apache Software Foundation (ASF) under one
4
-# or more contributor license agreements.  See the NOTICE file
5
-# distributed with this work for additional information
6
-# regarding copyright ownership.  The ASF licenses this file
7
-# to you under the Apache License, Version 2.0 (the
8
-# "License"); you may not use this file except in compliance
9
-# with the License.  You may obtain a copy of the License at
10
-#
11
-# http://www.apache.org/licenses/LICENSE-2.0
12
-#
13
-# Unless required by applicable law or agreed to in writing,
14
-# software distributed under the License is distributed on an
15
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
-#  KIND, either express or implied.  See the License for the
17
-# specific language governing permissions and limitations
18
-# under the License.
19
-#
20
--->
21
-# Release Notes
22
-
23
-### 6.0.2 (Jun 27, 2019)
24
-
25
--   fix: manually fix line endings of some files that were using CRLF ([`e8e06c3`](https://github.com/apache/cordova-plugin-file/commit/e8e06c3))
26
--   chore: fix repo and issue urls and license in package.json and plugin.xml ([`1bca166`](https://github.com/apache/cordova-plugin-file/commit/1bca166))
27
--   docs: remove outdated translations ([`a898b85`](https://github.com/apache/cordova-plugin-file/commit/a898b85))
28
--   build: add `.gitattributes` to force LF (instead of possible CRLF on Windows) ([`d691a04`](https://github.com/apache/cordova-plugin-file/commit/d691a04))
29
--   build: add `.npmignore` to remove unneeded files from npm package ([`a255202`](https://github.com/apache/cordova-plugin-file/commit/a255202))
30
--   ci(travis): Update Travis CI configuration for new paramedic ([#314](https://github.com/apache/cordova-plugin-file/issues/314)) ([`2b93a67`](https://github.com/apache/cordova-plugin-file/commit/2b93a67))
31
--   fix(browser): support safari private browsing mode by using base64 text instead of blob ([#301](https://github.com/apache/cordova-plugin-file/issues/301)) ([`c609ff6`](https://github.com/apache/cordova-plugin-file/commit/c609ff6))
32
--   chore(github): Add or update GitHub pull request and issue template ([`b762743`](https://github.com/apache/cordova-plugin-file/commit/b762743))
33
--   fix(types): CB-13569: fix inverted LocalFileSystem enum ([#274](https://github.com/apache/cordova-plugin-file/issues/274)) ([`d135cd0`](https://github.com/apache/cordova-plugin-file/commit/d135cd0))
34
--   docs: remove JIRA link ([`341fa9c`](https://github.com/apache/cordova-plugin-file/commit/341fa9c))
35
--   fix(types): CB-13850: Fix spelling in typed-file: property name filesystem (wrong… ([#229](https://github.com/apache/cordova-plugin-file/issues/229)) ([`4642fde`](https://github.com/apache/cordova-plugin-file/commit/4642fde))
36
--   fix(types): CB-13960: fix FileWriter.write argument type definition for typescript ([#231](https://github.com/apache/cordova-plugin-file/issues/231)) ([`5353b84`](https://github.com/apache/cordova-plugin-file/commit/5353b84))
37
--   ci(travis): also accept terms for android sdk `android-27` ([`6e7871b`](https://github.com/apache/cordova-plugin-file/commit/6e7871b))
38
--   docs: add details for `applicationDirectory` on android ([#234](https://github.com/apache/cordova-plugin-file/issues/234)) ([`c2f5216`](https://github.com/apache/cordova-plugin-file/commit/c2f5216))
39
--   fix: require FileReader in FileWriter to fix 'write' exec not being called ([#237](https://github.com/apache/cordova-plugin-file/issues/237)) ([`4a92bbb`](https://github.com/apache/cordova-plugin-file/commit/4a92bbb))
40
--   fix(android): CB-14181: (android) Fix bug - Cannot read property 'filesystemName' of null ([#235](https://github.com/apache/cordova-plugin-file/issues/235)) ([`cc3aedb`](https://github.com/apache/cordova-plugin-file/commit/cc3aedb))
41
--   ci(travis): CB-13753: Add build-tools-26.0.2 to travis ([#228](https://github.com/apache/cordova-plugin-file/issues/228)) ([`d8cc0fd`](https://github.com/apache/cordova-plugin-file/commit/d8cc0fd), [`5e12b5e`](https://github.com/apache/cordova-plugin-file/commit/5e12b5e))
42
--   chore: Fix release notes ([#227](https://github.com/apache/cordova-plugin-file/issues/227)) ([`c248827`](https://github.com/apache/cordova-plugin-file/commit/c248827))
43
-
44
-
45
-### 6.0.1 (Dec 27, 2017)
46
-* [CB-13704](https://issues.apache.org/jira/browse/CB-13704) Fix to allow 6.0.0 version install
47
-
48
-### 6.0.0 (Dec 15, 2017)
49
-* [CB-13668](https://issues.apache.org/jira/browse/CB-13668) Remove deprecated platforms
50
-
51
-### 5.0.0 (Nov 06, 2017)
52
-* [CB-13481](https://issues.apache.org/jira/browse/CB-13481) (android) Don't ask for permission to read `file:///android_asset/`
53
-* [CB-13518](https://issues.apache.org/jira/browse/CB-13518) Add 'protective' entry to `cordovaDependencies`
54
-* [CB-13472](https://issues.apache.org/jira/browse/CB-13472) (CI) Fixed Travis **Android** builds again
55
-* [CB-13294](https://issues.apache.org/jira/browse/CB-13294) Remove `cordova-plugin-compat`
56
-* fixing `README` in use of `window.resolveLocalFileSystemURL`
57
-* [CB-12895](https://issues.apache.org/jira/browse/CB-12895) setup `eslint` and took out `jshint`
58
-* [CB-13028](https://issues.apache.org/jira/browse/CB-13028) (CI) **Browser** builds on Travis
59
-* [CB-13000](https://issues.apache.org/jira/browse/CB-13000) (CI) Speed up **Android** builds
60
-* [CB-12355](https://issues.apache.org/jira/browse/CB-12355) (iOS) add desciption about the `mimeTypeForFileAtPath` method
61
-* [CB-12355](https://issues.apache.org/jira/browse/CB-12355) (iOS) fix `FileEntry.file.type`
62
-* [CB-12847](https://issues.apache.org/jira/browse/CB-12847) added `bugs` entry to `package.json`.
63
-
64
-### 4.3.3 (Apr 27, 2017)
65
-* [CB-12622](https://issues.apache.org/jira/browse/CB-12622) Added **Android 6.0** build badge to `README`
66
-* [CB-12685](https://issues.apache.org/jira/browse/CB-12685) added `package.json` to tests folder
67
-
68
-### 4.3.2 (Feb 28, 2017)
69
-* [CB-12353](https://issues.apache.org/jira/browse/CB-12353) Corrected merges usage in `plugin.xml`
70
-* [CB-12369](https://issues.apache.org/jira/browse/CB-12369) Add plugin typings from `DefinitelyTyped`
71
-* [CB-12363](https://issues.apache.org/jira/browse/CB-12363) Added build badges for **iOS 9.3** and **iOS 10.0**
72
-* [CB-12230](https://issues.apache.org/jira/browse/CB-12230) Removed **Windows 8.1** build badges
73
-
74
-### 4.3.1 (Dec 07, 2016)
75
-* [CB-12224](https://issues.apache.org/jira/browse/CB-12224) Updated version and RELEASENOTES.md for release 4.3.1
76
-* [CB-12112](https://issues.apache.org/jira/browse/CB-12112) windows: Make available to move folder trees
77
-* fix ENCODING_ERR for applicationDirectory
78
-* [CB-11848](https://issues.apache.org/jira/browse/CB-11848) windows: Remove duplicate slash after file system path
79
-* [CB-11917](https://issues.apache.org/jira/browse/CB-11917) - Remove pull request template checklist item: "iCLA has been submitted…"
80
-* [CB-11947](https://issues.apache.org/jira/browse/CB-11947) fixed typo that occurs when adding file-transfer plugin
81
-* [CB-11832](https://issues.apache.org/jira/browse/CB-11832) Incremented plugin version.
82
-
83
-### 4.3.0 (Sep 08, 2016)
84
-* [CB-11795](https://issues.apache.org/jira/browse/CB-11795) Add 'protective' entry to cordovaDependencies
85
-* Add handling for `SecurityException`
86
-* [CB-11368](https://issues.apache.org/jira/browse/CB-11368) **android**: Resolve content `URLs` produced by contacts plugin
87
-* Plugin uses `Android Log class` and not `Cordova LOG class`
88
-* [CB-11693](https://issues.apache.org/jira/browse/CB-11693) **ios**: Run copy and move operations in the background thread
89
-* [CB-11699](https://issues.apache.org/jira/browse/CB-11699) Read files as Data URLs properly
90
-* [CB-11305](https://issues.apache.org/jira/browse/CB-11305) Enable `cdvfile: assets fs root` for `DOM` requests
91
-* [CB-11385](https://issues.apache.org/jira/browse/CB-11385) android: Import java.nio.charset.Charset in LocalFileSystem class
92
-* Add badges for paramedic builds on Jenkins
93
-* [CB-11407](https://issues.apache.org/jira/browse/CB-11407) ios: added extern keyword to constants to fix phonegap-webview-ios template issue.
94
-* [CB-11385](https://issues.apache.org/jira/browse/CB-11385) **android**: Does not pass sonarqube scan
95
-* Add pull request template.
96
-* Minor edits to the `README.md`
97
-* [CB-11142](https://issues.apache.org/jira/browse/CB-11142) Fix the `NeedPermission` code for the case when external media is not mounted in Android
98
-* [CB-11003](https://issues.apache.org/jira/browse/CB-11003) Adding samples to Readme.
99
-* [CB-10996](https://issues.apache.org/jira/browse/CB-10996) Adding front matter to README.md
100
-* [CB-11115](https://issues.apache.org/jira/browse/CB-11115) **android**: Removing dependency on FileDescriptor toString in content provider tests
101
-
102
-### 4.2.0 (Apr 15, 2016)
103
-* [CB-10960](https://issues.apache.org/jira/browse/CB-10960) Uncaught `#<FileError>` in `write()` when `readyState != WRITING ?`
104
-* Replace `PermissionHelper.java` with `cordova-plugin-compat`
105
-* [CB-10977](https://issues.apache.org/jira/browse/CB-10977) **Android** Removing global state used for permission requests
106
-* CB-10798, [CB-10384](https://issues.apache.org/jira/browse/CB-10384) Fixing permissions for **Marshmallow**.
107
-* Fix test failure on **WP 8.1**
108
-* [CB-10577](https://issues.apache.org/jira/browse/CB-10577) **Windows** `resolveLocalFileSystemURL` should omit trailing slash for file
109
-* [CB-7862](https://issues.apache.org/jira/browse/CB-7862) `FileReader` reads large files in chunks with progress.
110
-* [CB-10577](https://issues.apache.org/jira/browse/CB-10577) **Android** `resolveLocalFileSystemURL` should detect directory vs file.
111
-* [CB-9753](https://issues.apache.org/jira/browse/CB-9753) index out of bounds on `requestFileSystem`.
112
-* Remove `warning` emoji, as it doesn't correctly display in the docs website: cordova.apache.org/docs/en/dev/cordova-plugin-file/index.html. This closes #166
113
-* [CB-10636](https://issues.apache.org/jira/browse/CB-10636) Add `JSHint` for plugins
114
-* [CB-10411](https://issues.apache.org/jira/browse/CB-10411) Error in `file.spec.129` of `cordova-plugin-file`
115
-
116
-### 4.1.1 (Feb 09, 2016)
117
-* Edit package.json license to match SPDX id
118
-* [CB-10419](https://issues.apache.org/jira/browse/CB-10419) cordova-plugin-file 4.0.0 error with browserify workflow
119
-
120
-### 4.1.0 (Jan 15, 2016)
121
-* added `.ratignore` file
122
-* [CB-10319](https://issues.apache.org/jira/browse/CB-10319) **android** Adding reflective helper methods for permission requests
123
-* [CB-10023](https://issues.apache.org/jira/browse/CB-10023) Fix `proxy not found error` on Chrome.
124
-* [CB-8863](https://issues.apache.org/jira/browse/CB-8863) **ios** Fix block usage of self
125
-
126
-### 4.0.0 (Nov 18, 2015)
127
-* [CB-10035](https://issues.apache.org/jira/browse/CB-10035) Updated `RELEASENOTES` to be newest to oldest
128
-* [CB-8497](https://issues.apache.org/jira/browse/CB-8497) Fix handling of file paths with `#` character
129
-* Do not inject default `AndroidPersistentFileLocation` into `config.xml`
130
-* [CB-9891](https://issues.apache.org/jira/browse/CB-9891): Fix permission errors due to `URI encoding` inconsistency on **Android**
131
-* Fixed `NullPointer Exception` in **Android 5** and above due to invalid column name on cursor
132
-* Fix default persistent file location
133
-* fix `applicationDirectory` to use `ms-appx:///`
134
-* Add **Windows** paths to `cordova.file` object
135
-* [CB-9851](https://issues.apache.org/jira/browse/CB-9851) Document `cdvfile` protocol quirk - using `cdvfile://` in the `DOM` is not supported on **Windows**
136
-* [CB-9752](https://issues.apache.org/jira/browse/CB-9752) `getDirectory` fails on valid directory with assets filesystem
137
-* [CB-7253](https://issues.apache.org/jira/browse/CB-7253) `requestFileSystem` fails when no external storage is present
138
-* Adding permissions for **Marshmallow**. Now supports **Anrdoid 6.0**
139
-* Fixing contribute link.
140
-* always use setters to fix memory issues without `ARC` for **iOS**
141
-* [CB-9331](https://issues.apache.org/jira/browse/CB-9331) `getFreeDiskSpace` **iOS**.
142
-* override `resolveLocalFileSystemURL` by `webkitResolveLocalFileSystemURL` for **browser** platform add `.project` into git ignore list
143
-* Fail with `FileError.ENCODING_ERR` on encoding exception.
144
-* [CB-9544](https://issues.apache.org/jira/browse/CB-9544) Add file plugin for **OSX**
145
-* [CB-9539](https://issues.apache.org/jira/browse/CB-9539) Fixed test failure on **Android** emulator
146
-* Added docs on `CSP` rules needed for using `cdvfile` in DOM src. This closes #120
147
-* Added `cdvfile` protocol purpose description and examples
148
-
149
-### 3.0.0 (Aug 18, 2015)
150
-* Make Android default persistent file location internal
151
-* Fixed issue with file paths not existing when using browserify
152
-* [CB-9251](https://issues.apache.org/jira/browse/CB-9251): Changed from Intents to Preferences object as per the issue
153
-* [CB-9215](https://issues.apache.org/jira/browse/CB-9215) Add cordova-plugin-file manual test for windows platform
154
-
155
-### 2.1.0 (Jun 17, 2015)
156
-* added missing license header
157
-* [CB-9128](https://issues.apache.org/jira/browse/CB-9128) cordova-plugin-file documentation translation: cordova-plugin-file
158
-* fix npm md
159
-* [CB-8844](https://issues.apache.org/jira/browse/CB-8844) Increased timeout for asset tests
160
-* Updated resolveFileSystem.js so it can be parsed by uglifyJS
161
-* [CB-8860](https://issues.apache.org/jira/browse/CB-8860) cordova-plugin-file documentation translation: cordova-plugin-file
162
-* [CB-8792](https://issues.apache.org/jira/browse/CB-8792) Fixes reading of json files using readAsText
163
-
164
-### 2.0.0 (Apr 15, 2015)
165
-* [CB-8849](https://issues.apache.org/jira/browse/CB-8849) Fixed ReadAsArrayBuffer to return ArrayBuffer and not Array on WP8
166
-* [CB-8819](https://issues.apache.org/jira/browse/CB-8819) Fixed FileReader's readAsBinaryString on wp8
167
-* [CB-8746](https://issues.apache.org/jira/browse/CB-8746) gave plugin major version bump
168
-* [CB-8683](https://issues.apache.org/jira/browse/CB-8683) android: Fix broken unit tests from plugin rename
169
-* [CB-8683](https://issues.apache.org/jira/browse/CB-8683) changed plugin-id to pacakge-name
170
-* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) properly updated translated docs to use new id
171
-* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) updated translated docs to use new id
172
-* Use TRAVIS_BUILD_DIR, install paramedic by npm
173
-* docs: added Windows to supported platforms
174
-* [CB-8699](https://issues.apache.org/jira/browse/CB-8699) [CB-6428](https://issues.apache.org/jira/browse/CB-6428) Fix uncompressed assets being copied as zero length files
175
-* [CB-6428](https://issues.apache.org/jira/browse/CB-6428) android: Fix assets FileEntry having size of -1
176
-* android: Move URLforFullPath into base class (and rename to localUrlforFullPath)
177
-* [CB-6428](https://issues.apache.org/jira/browse/CB-6428) Mention build-extras.gradle in README
178
-* [CB-7109](https://issues.apache.org/jira/browse/CB-7109) android: Parse arguments off of the main thread (close #97)
179
-* [CB-8695](https://issues.apache.org/jira/browse/CB-8695) ios: Fix `blob.slice()` for `asset-library` URLs (close #105)
180
-* Tweak build-extras.gradle to just read/write to main `assets/` instead of `build/`
181
-* [CB-8689](https://issues.apache.org/jira/browse/CB-8689) Fix NPE in makeEntryForNativeUri (was affecting file-transfer)
182
-* [CB-8675](https://issues.apache.org/jira/browse/CB-8675) Revert "CB-8351 ios: Use base64EncodedStringWithOptions instead of CordovaLib's class extension"
183
-* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) Updated Readme
184
-* [CB-8659](https://issues.apache.org/jira/browse/CB-8659): ios: 4.0.x Compatibility: Remove use of initWebView method
185
-* Add a cache to speed up AssetFilesystem directory listings
186
-* [CB-8663](https://issues.apache.org/jira/browse/CB-8663) android: Don't notify MediaScanner of private files
187
-* Don't log stacktrace for normal exceptions (e.g. file not found)
188
-* android: Don't use LimitedInputStream when reading entire file (optimization)
189
-* [CB-6428](https://issues.apache.org/jira/browse/CB-6428) android: Add support for directory copies from assets -> filesystem
190
-* android: Add `listChildren()`: Java-consumable version of `readEntriesAtLocalURL()`
191
-* [CB-6428](https://issues.apache.org/jira/browse/CB-6428) android: Add support for file:///android_asset URLs
192
-* [CB-8642](https://issues.apache.org/jira/browse/CB-8642) android: Fix content URIs not working with resolve / copy
193
-* Tweak tests to fail if deleteEntry fails (rather than time out)
194
-* android: Ensure LocalFilesystemURL can only be created with "cdvfile" URLs
195
-* android: Move CordovaResourceApi into Filesystem base class
196
-* android: Use `CordovaResourceApi.mapUriToFile()` rather than own custom logic in ContentFilesystem
197
-* android: Use Uri.parse rather than manual parsing in resolveLocalFileSystemURI
198
-* Tweak test case that failed twice on error rather than just once
199
-* android: Delete invalid JavaDoc (lint errors)
200
-* android: Use CordovaResourceApi rather than FileHelper
201
-* [CB-8032](https://issues.apache.org/jira/browse/CB-8032) - File Plugin - Add nativeURL external method support for CDVFileSystem->makeEntryForPath:isDirectory: (closes #96)
202
-* [CB-8567](https://issues.apache.org/jira/browse/CB-8567) Integrate TravisCI
203
-* [CB-8438](https://issues.apache.org/jira/browse/CB-8438) cordova-plugin-file documentation translation: cordova-plugin-file
204
-* [CB-8538](https://issues.apache.org/jira/browse/CB-8538) Added package.json file
205
-* [CB-7956](https://issues.apache.org/jira/browse/CB-7956) Add cordova-plugin-file support for browser platform
206
-* [CB-8423](https://issues.apache.org/jira/browse/CB-8423) Corrected usage of done() in async tests
207
-* [CB-8459](https://issues.apache.org/jira/browse/CB-8459) Fixes spec 111 failure due to incorrect relative paths handling
208
-* Code cleanup, whitespace
209
-* Added nativeURL property to FileEntry, implemented readAsArrayBuffer and readAsBinaryString
210
-
211
-### 1.3.3 (Feb 04, 2015)
212
-* [CB-7927](https://issues.apache.org/jira/browse/CB-7927) Encoding data to bytes instead of chars when writing a file.
213
-* ios: Fix compile warning about implicit int conversion
214
-* [CB-8351](https://issues.apache.org/jira/browse/CB-8351) ios: Use base64EncodedStringWithOptions instead of CordovaLib's class extension
215
-* [CB-8351](https://issues.apache.org/jira/browse/CB-8351) ios: Use argumentForIndex rather than NSArray extension
216
-* [CB-8351](https://issues.apache.org/jira/browse/CB-8351) ios: Use a local copy of valueForKeyIsNumber rather than CordovaLib's version
217
-* windows: Handle url's containing absolute windows path starting with drive letter and colon (encoded as %3A) through root FS
218
-* windows: Rework to use normal url form
219
-* android: refactor: Make Filesystem base class store its own name, rootUri, and rootEntry
220
-* android: Simplify code a bit by making makeEntryForPath not throw JSONException
221
-* [CB-6431](https://issues.apache.org/jira/browse/CB-6431) android: Fix plugin breaking content: URLs
222
-* [CB-7375](https://issues.apache.org/jira/browse/CB-7375) Never create new FileSystem instances (except on windows since they don't implement requestAllFileSystems())
223
-
224
-### 1.3.2 (Dec 02, 2014)
225
-* Gets rid of thread block error in File plugin
226
-* [CB-7917](https://issues.apache.org/jira/browse/CB-7917) Made tests file.spec.114 - 116 pass for **Windows** platform
227
-* [CB-7977](https://issues.apache.org/jira/browse/CB-7977) Mention `deviceready` in plugin docs
228
-* [CB-7602](https://issues.apache.org/jira/browse/CB-7602): Fix `isCopyOnItself` logic
229
-* [CB-7700](https://issues.apache.org/jira/browse/CB-7700) cordova-plugin-file documentation translation: cordova-plugin-file
230
-* Use one proxy for both **Windows** and **Windows8** platforms
231
-* [CB-6994](https://issues.apache.org/jira/browse/CB-6994) Fixes result, returned by proxy's write method
232
-* [fxos] update `__format__` to match `pathsPrefix`
233
-* [CB-6994](https://issues.apache.org/jira/browse/CB-6994) Improves merged code to be able to write a File
234
-* Optimize `FileProxy` for **Windows** platforms
235
-* Synchronize changes with **Windows** platform
236
-* Fix function write for big files on **Windows 8**
237
-* Write file in background
238
-* [CB-7487](https://issues.apache.org/jira/browse/CB-7487) **Android** Broadcast file write This allows MTP USB shares to show the file immediately without reboot/manual refresh using 3rd party app.
239
-* [CB-7700](https://issues.apache.org/jira/browse/CB-7700) cordova-plugin-file documentation translation: cordova-plugin-file
240
-* [CB-7571](https://issues.apache.org/jira/browse/CB-7571) Bump version of nested plugin to match parent plugin
241
-
242
-### 1.3.1 (Sep 17, 2014)
243
-* [CB-7471](https://issues.apache.org/jira/browse/CB-7471) cordova-plugin-file documentation translation
244
-* [CB-7272](https://issues.apache.org/jira/browse/CB-7272) Replace confusing "r/o" abbreviation with just "r"
245
-* [CB-7423](https://issues.apache.org/jira/browse/CB-7423) encode path before attempting to resolve
246
-* [CB-7375](https://issues.apache.org/jira/browse/CB-7375) Fix the filesystem name in resolveLocalFileSystemUri
247
-* [CB-7445](https://issues.apache.org/jira/browse/CB-7445) [BlackBerry10] resolveLocalFileSystemURI - change DEFAULT_SIZE to MAX_SIZE
248
-* [CB-7458](https://issues.apache.org/jira/browse/CB-7458) [BlackBerry10] resolveLocalFileSystemURL - add filesystem property
249
-* [CB-7445](https://issues.apache.org/jira/browse/CB-7445) [BlackBerry10] Add default file system size to prevent quota exceeded error on initial install
250
-* [CB-7431](https://issues.apache.org/jira/browse/CB-7431) Avoid calling done() twice in file.spec.109 test
251
-* [CB-7413](https://issues.apache.org/jira/browse/CB-7413) Adds support of 'ms-appdata://' URIs
252
-* [CB-7422](https://issues.apache.org/jira/browse/CB-7422) [File Tests] Use proper fileSystem to create fullPath
253
-* [CB-7375](https://issues.apache.org/jira/browse/CB-7375) [Entry] get proper filesystem in Entry
254
-* Amazon related changes.
255
-* [CB-7375](https://issues.apache.org/jira/browse/CB-7375) Remove leading slash statement from condition
256
-* Refactored much of the logic in FileMetadata constructor.  Directory.size will return 0
257
-* [CB-7419](https://issues.apache.org/jira/browse/CB-7419) [WP8] Added support to get metada from dir
258
-* [CB-7418](https://issues.apache.org/jira/browse/CB-7418) [DirectoryEntry] Added fullPath variable as part of condition
259
-* [CB-7417](https://issues.apache.org/jira/browse/CB-7417) [File tests] added proper matcher to compare fullPath property
260
-* [CB-7375](https://issues.apache.org/jira/browse/CB-7375) Partial revert to resolve WP8 failures
261
-* Overwrite existing file on getFile when create is true
262
-* [CB-7375](https://issues.apache.org/jira/browse/CB-7375) [CB-6148](https://issues.apache.org/jira/browse/CB-6148): Ensure that return values from copy and move operations reference the correct filesystem
263
-* [CB-6724](https://issues.apache.org/jira/browse/CB-6724) changed style detail on documentation
264
-* Added new js files to amazon-fireos platform.
265
-* Adds Windows platform
266
-* Fixes multiple mobilespec tests errors
267
-* Removed test/tests.js module from main plugin.xml
268
-* [CB-7094](https://issues.apache.org/jira/browse/CB-7094) renamed folder to tests + added nested plugin.xml
269
-* added documentation for manual tests
270
-* [CB-6923](https://issues.apache.org/jira/browse/CB-6923) Adding support to handle relative paths
271
-* Style improvements on Manual tests
272
-* [CB-7094](https://issues.apache.org/jira/browse/CB-7094) Ported File manual tests
273
-
274
-### 1.3.0 (Aug 06, 2014)
275
-* **FFOS** Remove unsupported paths from requestAllPaths
276
-* **FFOS** Support for resolve URI, request all paths and local app directory.
277
-* [CB-4263](https://issues.apache.org/jira/browse/CB-4263) set ready state to done before onload
278
-* [CB-7167](https://issues.apache.org/jira/browse/CB-7167) [BlackBerry10] copyTo - return wrapped entry rather than native
279
-* [CB-7167](https://issues.apache.org/jira/browse/CB-7167) [BlackBerry10] Add directory support to getFileMetadata
280
-* [CB-7167](https://issues.apache.org/jira/browse/CB-7167) [BlackBerry10] Fix tests detection of blob support (window.Blob is BlobConstructor object)
281
-* [CB-7161](https://issues.apache.org/jira/browse/CB-7161) [BlackBerry10] Add file system directory paths
282
-* [CB-7093](https://issues.apache.org/jira/browse/CB-7093) Create separate plugin.xml for new-style tests
283
-* [CB-7057](https://issues.apache.org/jira/browse/CB-7057) Docs update: elaborate on what directories are for
284
-* [CB-7093](https://issues.apache.org/jira/browse/CB-7093): Undo the effects of an old bad S&R command
285
-* [CB-7093](https://issues.apache.org/jira/browse/CB-7093): Remove a bunch of unneeded log messages
286
-* [CB-7093](https://issues.apache.org/jira/browse/CB-7093): Add JS module to plugin.xml file for auto-tests
287
-* [CB-7093](https://issues.apache.org/jira/browse/CB-7093) Ported automated file tests
288
-* **WINDOWS** remove extra function closure, not    needed
289
-* **WINDOWS** remove check for undefined fail(), it is defined by the proxy and always exists
290
-* **WINDOWS** re-apply readAsBinaryString and readAsArrayBuffer
291
-* **WINDOWS** Moved similar calls to be the same calls, aliased long namespaced functions
292
-* [CB-6127](https://issues.apache.org/jira/browse/CB-6127) Updated translations for docs.
293
-* [CB-6571](https://issues.apache.org/jira/browse/CB-6571) Fix getParentForLocalURL to work correctly with directories with trailing '/' (This closes #58)
294
-* UTTypeCopyPreferredTagWithClass returns nil mimetype for css when there is no network
295
-* updated spec links in docs ( en only )
296
-* [CB-6571](https://issues.apache.org/jira/browse/CB-6571) add trailing space it is missing in DirectoryEnty constructor.
297
-* [CB-6980](https://issues.apache.org/jira/browse/CB-6980) Fixing filesystem:null property in Entry
298
-* Add win8 support for readAsBinaryString and readAsArrayBuffer
299
-* [FFOS] Update FileProxy.js
300
-* [CB-6940](https://issues.apache.org/jira/browse/CB-6940): Fixing up commit from dzeims
301
-* [CB-6940](https://issues.apache.org/jira/browse/CB-6940): Android: cleanup try/catch exception handling
302
-* [CB-6940](https://issues.apache.org/jira/browse/CB-6940): `context.getExternal*` methods return null if sdcard isn't in mounted state, causing exceptions that prevent startup from reaching readystate
303
-* Fix mis-handling of filesystem reference in Entry.moveTo ('this' used in closure).
304
-* [CB-6902](https://issues.apache.org/jira/browse/CB-6902): Use File.lastModified rather than .lastModifiedDate
305
-* [CB-6922](https://issues.apache.org/jira/browse/CB-6922): Remove unused getMetadata native code
306
-* [CB-6922](https://issues.apache.org/jira/browse/CB-6922): Use getFileMetadata consistently to get metadata
307
-* changed fullPath to self.rootDocsPath
308
-* [CB-6890](https://issues.apache.org/jira/browse/CB-6890): Fix pluginManager access for 4.0.x branch
309
-
310
-### 1.2.1
311
-* [CB-6922](https://issues.apache.org/jira/browse/CB-6922) Fix inconsistent handling of lastModifiedDate and modificationTime
312
-* [CB-285](https://issues.apache.org/jira/browse/CB-285): Document filesystem root properties
313
-
314
-### 1.2.0 (Jun 05, 2014)
315
-* [CB-6127](https://issues.apache.org/jira/browse/CB-6127) Spanish and French Translations added. Github close #31
316
-* updated this reference to window
317
-* Add missing semicolon (copy & paste error)
318
-* Fix compiler warning about symbol in interface not matching implementation
319
-* Fix sorting order in supported platforms
320
-* ubuntu: increase quota value
321
-* ubuntu: Change FS URL scheme to 'cdvfile'
322
-* ubuntu: Return size with Entry.getMetadata() method
323
-* [CB-6803](https://issues.apache.org/jira/browse/CB-6803) Add license
324
-* Initial implementation for Firefox OS
325
-* Small wording tweaks
326
-* Fixed toURL() toInternalURL() information in the doku
327
-* ios: Don't fail a write of zero-length payload.
328
-* [CB-285](https://issues.apache.org/jira/browse/CB-285) Docs for cordova.file.\*Directory properties
329
-* [CB-285](https://issues.apache.org/jira/browse/CB-285) Add cordova.file.\*Directory properties for iOS & Android
330
-* [CB-3440](https://issues.apache.org/jira/browse/CB-3440) [BlackBerry10] Proxy based implementation
331
-* Fix typo in docs "app-bundle" -> "bundle"
332
-* [CB-6583](https://issues.apache.org/jira/browse/CB-6583) ios: Fix failing to create entry when space in parent path
333
-* [CB-6571](https://issues.apache.org/jira/browse/CB-6571) android: Make DirectoryEntry.toURL() have a trailing /
334
-* [CB-6491](https://issues.apache.org/jira/browse/CB-6491) add CONTRIBUTING.md
335
-* [CB-6525](https://issues.apache.org/jira/browse/CB-6525) android, ios: Allow file: URLs in all APIs. Fixes FileTransfer.download not being called.
336
-* fix the Windows 8  implementation of the getFile method
337
-* Update File.js for typo: lastModifiedData --> lastModifiedDate (closes #38)
338
-* Add error codes.
339
-* [CB-5980](https://issues.apache.org/jira/browse/CB-5980) Updated version and RELEASENOTES.md for release 1.0.0
340
-* Add NOTICE file
341
-* [CB-6114](https://issues.apache.org/jira/browse/CB-6114) Updated version and RELEASENOTES.md for release 1.0.1
342
-* [CB-5980](https://issues.apache.org/jira/browse/CB-5980) Updated version and RELEASENOTES.md for release 1.0.0
343
-
344
-### 1.1.0 (Apr 17, 2014)
345
-* [CB-4965](https://issues.apache.org/jira/browse/CB-4965): Remove tests from file plugin
346
-* Android: Allow file:/ URLs
347
-* [CB-6422](https://issues.apache.org/jira/browse/CB-6422): [windows8] use cordova/exec/proxy
348
-* [CB-6249](https://issues.apache.org/jira/browse/CB-6249): [android] Opportunistically resolve content urls to file
349
-* [CB-6394](https://issues.apache.org/jira/browse/CB-6394): [ios, android] Add extra filesystem roots
350
-* [CB-6394](https://issues.apache.org/jira/browse/CB-6394): [ios, android] Fix file resolution for the device root case
351
-* [CB-6394](https://issues.apache.org/jira/browse/CB-6394): [ios] Return ENCODING_ERR when fs name is not valid
352
-* [CB-6393](https://issues.apache.org/jira/browse/CB-6393): Change behaviour of toURL and toNativeURL
353
-* ios: Style: plugin initialization
354
-* ios: Fix handling of file URLs with encoded spaces
355
-* Always use Android's recommended temp file location for temporary file system
356
-* [CB-6352](https://issues.apache.org/jira/browse/CB-6352): Allow FileSystem objects to be serialized to JSON
357
-* [CB-5959](https://issues.apache.org/jira/browse/CB-5959): size is explicitly 0 if not set, file.spec.46&47 are testing the type of size
358
-* [CB-6242](https://issues.apache.org/jira/browse/CB-6242): [BlackBerry10] Add deprecated version of resolveLocalFileSystemURI
359
-* [CB-6242](https://issues.apache.org/jira/browse/CB-6242): [BlackBerry10] add file:/// prefix for toURI / toURL
360
-* [CB-6242](https://issues.apache.org/jira/browse/CB-6242): [BlackBerry10] Polyfill window.requestAnimationFrame for OS < 10.2
361
-* [CB-6242](https://issues.apache.org/jira/browse/CB-6242): [BlackBerry10] Override window.resolveLocalFileSystemURL
362
-* [CB-6212](https://issues.apache.org/jira/browse/CB-6212): [iOS] fix warnings compiled under arm64 64-bit
363
-* ios: Don't cache responses from CDVFile's URLProtocol
364
-* [CB-6199](https://issues.apache.org/jira/browse/CB-6199): [iOS] Fix toNativeURL() not escaping characters properly
365
-* [CB-6148](https://issues.apache.org/jira/browse/CB-6148): Fix cross-filesystem copy and move
366
-* fixed setMetadata() to use the formatted fullPath
367
-* corrected typo which leads to a "comma expression"
368
-* [CB-4952](https://issues.apache.org/jira/browse/CB-4952): ios: Resolve symlinks in file:// URLs
369
-* Add docs about the extraFileSystems preference
370
-* [CB-6460](https://issues.apache.org/jira/browse/CB-6460): Update license headers
371
-
372
-### 1.0.1 (Feb 28, 2014)
373
-* [CB-6116](https://issues.apache.org/jira/browse/CB-6116) Fix error where resolveLocalFileSystemURL would fail
374
-* [CB-6106](https://issues.apache.org/jira/browse/CB-6106) Add support for nativeURL attribute on Entry objects
375
-* [CB-6110](https://issues.apache.org/jira/browse/CB-6110) iOS: Fix typo in filesystemPathForURL: method
376
-* Android: Use most specific FS match when resolving file: URIs
377
-* iOS: Update fileSystemURLforLocalPath: to return the most match url.
378
-* Allow third-party plugin registration, and the total count of fs type is not limited to just 4.
379
-* [CB-6097](https://issues.apache.org/jira/browse/CB-6097) Added missing files for amazon-fireos platform. Added onLoad flag to true.
380
-* [CB-6087](https://issues.apache.org/jira/browse/CB-6087) Android, iOS: Load file plugin on startup
381
-* [CB-6013](https://issues.apache.org/jira/browse/CB-6013) BlackBerry10: wrap webkit prefixed called in requestAnimationFrame
382
-* Update plugin writers' documentation
383
-* [CB-6080](https://issues.apache.org/jira/browse/CB-6080) Fix file copy when src and dst are on different local file systems
384
-* [CB-6057](https://issues.apache.org/jira/browse/CB-6057) Add methods for plugins to convert between URLs and paths
385
-* [CB-6050](https://issues.apache.org/jira/browse/CB-6050) Public method for returning a FileEntry from a device file path
386
-* [CB-2432](https://issues.apache.org/jira/browse/CB-2432) [CB-3185](https://issues.apache.org/jira/browse/CB-3185), [CB-5975](https://issues.apache.org/jira/browse/CB-5975): Fix Android handling of content:// URLs
387
-* [CB-6022](https://issues.apache.org/jira/browse/CB-6022) Add upgrade notes to doc
388
-* [CB-5233](https://issues.apache.org/jira/browse/CB-5233) Make asset-library urls work properly on iOS
389
-* [CB-6012](https://issues.apache.org/jira/browse/CB-6012) Preserve query strings on cdvfile:// URLs where necessary
390
-* [CB-6010](https://issues.apache.org/jira/browse/CB-6010) Test properly for presence of URLforFilesystemPath method
391
-* [CB-5959](https://issues.apache.org/jira/browse/CB-5959) Entry.getMetadata should return size attribute
392
-
393
-### 1.0.0 (Feb 05, 2014)
394
-* [CB-5974](https://issues.apache.org/jira/browse/CB-5974): Use safe 'Compatibilty' mode by default
395
-* [CB-5915](https://issues.apache.org/jira/browse/CB-5915): [CB-5916](https://issues.apache.org/jira/browse/CB-5916): Reorganize preference code to make defaults possible
396
-* [CB-5974](https://issues.apache.org/jira/browse/CB-5974): Android: Don't allow File operations to continue when not configured
397
-* [CB-5960](https://issues.apache.org/jira/browse/CB-5960): ios: android: Properly handle parent references in getFile/getDirectory
398
-* [ubuntu] adopt to recent changes
399
-* Add default FS root to new FS objects
400
-* [CB-5899](https://issues.apache.org/jira/browse/CB-5899): Make DirectoryReader.readEntries return properly formatted Entry objects
401
-* Add constuctor params to FileUploadResult related to [CB-2421](https://issues.apache.org/jira/browse/CB-2421)
402
-* Fill out filesystem attribute of entities returned from resolveLocalFileSystemURL
403
-* [CB-5916](https://issues.apache.org/jira/browse/CB-5916): Create documents directories if they don't exist
404
-* [CB-5915](https://issues.apache.org/jira/browse/CB-5915): Create documents directories if they don't exist
405
-* [CB-5916](https://issues.apache.org/jira/browse/CB-5916): Android: Fix unfortunate NPE in config check
406
-* [CB-5916](https://issues.apache.org/jira/browse/CB-5916): Android: Add "/files/" to persistent files path
407
-* [CB-5915](https://issues.apache.org/jira/browse/CB-5915): ios: Update config preference (and docs) to match issue
408
-* [CB-5916](https://issues.apache.org/jira/browse/CB-5916): Android: Add config preference for Android persistent storage location
409
-* iOS: Add config preference for iOS persistent storage location
410
-* iOS: Android: Allow third-party plugin registration
411
-* Android: Expose filePlugin getter so that other plugins can register filesystems
412
-* Fix typos in deprecation message
413
-* Add backwards-compatibility shim for file-transfer
414
-* Android: Allow third-party plugin registration
415
-* [CB-5810](https://issues.apache.org/jira/browse/CB-5810) [BlackBerry10] resolve local:/// paths (application assets)
416
-* [CB-5774](https://issues.apache.org/jira/browse/CB-5774): create DirectoryEntry instead of FileEntry
417
-* Initial fix for [CB-5747](https://issues.apache.org/jira/browse/CB-5747)
418
-* Change default FS URL scheme to "cdvfile"
419
-* Android: Properly format content urls
420
-* Android, iOS: Replace "filesystem" protocol string with constant
421
-* Android: Allow absolute paths on Entry.getFile / Entry.getDirectory
422
-* Android: Make clear that getFile takes a path, not just a filename
423
-* [CB-5008](https://issues.apache.org/jira/browse/CB-5008): Rename resolveLocalFileSystemURI to resolveLocalFileSystemURL; deprecate original
424
-* Remove old file reference from plugin.xml
425
-* Android: Refactor File API
426
-* [CB-4899](https://issues.apache.org/jira/browse/CB-4899) [BlackBerry10] Fix resolve directories
427
-* [CB-5602](https://issues.apache.org/jira/browse/CB-5602) Windows8. Fix File Api mobile spec tests
428
-* Android: Better support for content urls and cross-filesystem copy/move ops
429
-* [CB-5699](https://issues.apache.org/jira/browse/CB-5699) [BlackBerry10] Update resolveLocalFileSystemURI implementation
430
-* [CB-5658](https://issues.apache.org/jira/browse/CB-5658) Update license comment formatting of doc/index.md
431
-* [CB-5658](https://issues.apache.org/jira/browse/CB-5658) Add doc.index.md for File plugin.
432
-* [CB-5658](https://issues.apache.org/jira/browse/CB-5658) Delete stale snapshot of plugin docs
433
-* [CB-5403](https://issues.apache.org/jira/browse/CB-5403): Backwards-compatibility with file:// urls where possible
434
-* [CB-5407](https://issues.apache.org/jira/browse/CB-5407): Fixes for ContentFilesystem
435
-* Android: Add method for testing backwards-compatibility of filetransfer plugin
436
-* iOS: Add method for testing backwards-compatiblity of filetransfer plugin
437
-* Android: Updates to allow FileTransfer to continue to work
438
-* Android: Clean up unclosed file objects
439
-* [CB-5407](https://issues.apache.org/jira/browse/CB-5407): Cleanup
440
-* [CB-5407](https://issues.apache.org/jira/browse/CB-5407): Add new Android source files to plugin.xml
441
-* [CB-5407](https://issues.apache.org/jira/browse/CB-5407): Move read, write and truncate methods into modules
442
-* [CB-5407](https://issues.apache.org/jira/browse/CB-5407): Move copy/move methods into FS modules
443
-* [CB-5407](https://issues.apache.org/jira/browse/CB-5407): Move getParent into FS modules
444
-* [CB-5407](https://issues.apache.org/jira/browse/CB-5407): Move getmetadata methods into FS modules
445
-* [CB-5407](https://issues.apache.org/jira/browse/CB-5407): Move readdir methods into FS modules
446
-* [CB-5407](https://issues.apache.org/jira/browse/CB-5407): Move remove methods into FS modules
447
-* [CB-5407](https://issues.apache.org/jira/browse/CB-5407): Move getFile into FS modules
448
-* [CB-5407](https://issues.apache.org/jira/browse/CB-5407): Start refactoring android code: Modular filesystems, rfs, rlfsurl
449
-* [CB-5407](https://issues.apache.org/jira/browse/CB-5407): Update android JS to use FS urls
450
-* [CB-5405](https://issues.apache.org/jira/browse/CB-5405): Use URL formatting for Entry.toURL
451
-* [CB-5532](https://issues.apache.org/jira/browse/CB-5532) Fix
452
-* Log file path for File exceptions.
453
-* Partial fix for iOS File compatibility with previous fileTransfer plugin
454
-* [CB-5532](https://issues.apache.org/jira/browse/CB-5532) WP8. Add binary data support to FileWriter
455
-* [CB-5531](https://issues.apache.org/jira/browse/CB-5531) WP8. File Api readAsText incorrectly handles position args
456
-* Added ubuntu platform support
457
-* Added amazon-fireos platform support
458
-* [CB-5118](https://issues.apache.org/jira/browse/CB-5118) [BlackBerry10] Add check for undefined error handler
459
-* [CB-5406](https://issues.apache.org/jira/browse/CB-5406): Extend public API for dependent plugins
460
-* [CB-5403](https://issues.apache.org/jira/browse/CB-5403): Bump File plugin major version
461
-* [CB-5406](https://issues.apache.org/jira/browse/CB-5406): Split iOS file plugin into modules
462
-* [CB-5406](https://issues.apache.org/jira/browse/CB-5406): Factor out filesystem providers in iOS
463
-* [CB-5408](https://issues.apache.org/jira/browse/CB-5408): Add handler for filesystem:// urls
464
-* [CB-5406](https://issues.apache.org/jira/browse/CB-5406): Update iOS native code to use filesystem URLs internally
465
-* [CB-5405](https://issues.apache.org/jira/browse/CB-5405): Update JS code to use URLs exclusively
466
-* [CB-4816](https://issues.apache.org/jira/browse/CB-4816) Fix file creation outside sandbox for BB10
467
-
468
-### 0.2.5 (Oct 28, 2013)
469
-* [CB-5129](https://issues.apache.org/jira/browse/CB-5129): Add a consistent filesystem attribute to FileEntry and DirectoryEntry objects
470
-* [CB-5128](https://issues.apache.org/jira/browse/CB-5128): added repo + issue tag to plugin.xml for file plugin
471
-* [CB-5015](https://issues.apache.org/jira/browse/CB-5015) [BlackBerry10] Add missing dependency for File.slice
472
-* [CB-5010](https://issues.apache.org/jira/browse/CB-5010) Incremented plugin version on dev branch.
473
-
474
-### 0.2.4 (Oct 9, 2013)
475
-* [CB-5020](https://issues.apache.org/jira/browse/CB-5020) - File plugin should execute on a separate thread
476
-* [CB-4915](https://issues.apache.org/jira/browse/CB-4915) Incremented plugin version on dev branch.
477
-* [CB-4504](https://issues.apache.org/jira/browse/CB-4504): Updating FileUtils.java to compensate for Java porting failures in the Android SDK. This fails because Java knows nothing about android_asset not being an actual filesystem
478
-
479
-### 0.2.3 (Sept 25, 2013)
480
-* [CB-4889](https://issues.apache.org/jira/browse/CB-4889) bumping&resetting version
481
-* [CB-4903](https://issues.apache.org/jira/browse/CB-4903) File Plugin not loading Windows8
482
-* [CB-4903](https://issues.apache.org/jira/browse/CB-4903) File Plugin not loading Windows8
483
-* [CB-4889](https://issues.apache.org/jira/browse/CB-4889) renaming references
484
-* [CB-4889](https://issues.apache.org/jira/browse/CB-4889) renaming org.apache.cordova.core.file to org.apache.cordova.file
485
-* Rename CHANGELOG.md -> RELEASENOTES.md
486
-* [CB-4771](https://issues.apache.org/jira/browse/CB-4771) Expose TEMPORARY and PERSISTENT constants on window.
487
-* Fix compiler/lint warnings
488
-* [CB-4764](https://issues.apache.org/jira/browse/CB-4764) Move DirectoryManager.java into file plugin
489
-* [CB-4763](https://issues.apache.org/jira/browse/CB-4763) Copy FileHelper.java into the plugin.
490
-* [CB-2901](https://issues.apache.org/jira/browse/CB-2901) [BlackBerry10] Automatically unsandbox filesystem if path is not in app sandbox
491
-* [CB-4752](https://issues.apache.org/jira/browse/CB-4752) Incremented plugin version on dev branch.
492
-
493
-### 0.2.1 (Sept 5, 2013)
494
-* [CB-4656](https://issues.apache.org/jira/browse/CB-4656) Don't add newlines in data urls within readAsDataUrl.
495
-* [CB-4514](https://issues.apache.org/jira/browse/CB-4514) Making DirectoryCopy Recursive
496
-* [iOS] Simplify the code in resolveLocalFileSystemURI

+ 0
- 120
node_modules/cordova-plugin-file/doc/plugins.md Datei anzeigen

@@ -1,120 +0,0 @@
1
-<!---
2
-    Licensed to the Apache Software Foundation (ASF) under one
3
-    or more contributor license agreements.  See the NOTICE file
4
-    distributed with this work for additional information
5
-    regarding copyright ownership.  The ASF licenses this file
6
-    to you under the Apache License, Version 2.0 (the
7
-    "License"); you may not use this file except in compliance
8
-    with the License.  You may obtain a copy of the License at
9
-
10
-      http://www.apache.org/licenses/LICENSE-2.0
11
-
12
-    Unless required by applicable law or agreed to in writing,
13
-    software distributed under the License is distributed on an
14
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
-    KIND, either express or implied.  See the License for the
16
-    specific language governing permissions and limitations
17
-    under the License.
18
--->
19
-
20
-Notes for plugin developers
21
-===========================
22
-
23
-These notes are primarily intended for Android and iOS developers who want to write plugins which interface with the file system using the File plugin.
24
-
25
-Working with Cordova file system URLs
26
--------------------------------------
27
-
28
-Since version 1.0.0, this plugin has used URLs with a `cdvfile` scheme for all communication over the bridge, rather than exposing raw device file system paths to JavaScript. 
29
-
30
-On the JavaScript side, this means that FileEntry and DirectoryEntry objects have a fullPath attribute which is relative to the root of the HTML file system. If your plugin's JavaScript API accepts a FileEntry or DirectoryEntry object, you should call `.toURL()` on that object before passing it across the bridge to native code.
31
-
32
-### Converting cdvfile:// URLs to fileystem paths
33
-
34
-Plugins which need to write to the filesystem may want to convert a received file system URL to an actual filesystem location. There are multiple ways of doing this, depending on the native platform.
35
-
36
-It is important to remember that not all `cdvfile://` URLs are mappable to real files on the device. Some URLs can refer to assets on device which are not represented by files, or can even refer to remote resources. Because of these possibilities, plugins should always test whether they get a meaningful result back when trying to convert URLs to paths.
37
-
38
-#### Android
39
-
40
-On Android, the simplest method to convert a `cdvfile://` URL to a filesystem path is to use `org.apache.cordova.CordovaResourceApi`. `CordovaResourceApi` has several methods which can handle `cdvfile://` URLs:
41
-
42
-    // webView is a member of the Plugin class
43
-    CordovaResourceApi resourceApi = webView.getResourceApi();
44
-
45
-    // Obtain a file:/// URL representing this file on the device,
46
-    // or the same URL unchanged if it cannot be mapped to a file
47
-    Uri fileURL = resourceApi.remapUri(Uri.parse(cdvfileURL));
48
-
49
-It is also possible to use the File plugin directly:
50
-
51
-    import org.apache.cordova.file.FileUtils;
52
-    import org.apache.cordova.file.FileSystem;
53
-    import java.net.MalformedURLException;
54
-
55
-    // Get the File plugin from the plugin manager
56
-    FileUtils filePlugin = (FileUtils)webView.pluginManager.getPlugin("File");
57
-
58
-    // Given a URL, get a path for it
59
-    try {
60
-        String path = filePlugin.filesystemPathForURL(cdvfileURL);
61
-    } catch (MalformedURLException e) {
62
-        // The filesystem url wasn't recognized
63
-    }
64
-
65
-To convert from a path to a `cdvfile://` URL:
66
-
67
-    import org.apache.cordova.file.LocalFilesystemURL;
68
-
69
-    // Get a LocalFilesystemURL object for a device path,
70
-    // or null if it cannot be represented as a cdvfile URL.
71
-    LocalFilesystemURL url = filePlugin.filesystemURLforLocalPath(path);
72
-    // Get the string representation of the URL object
73
-    String cdvfileURL = url.toString();
74
-
75
-If your plugin creates a file, and you want to return a FileEntry object for it, use the File plugin:
76
-
77
-    // Return a JSON structure suitable for returning to JavaScript,
78
-    // or null if this file is not representable as a cdvfile URL.
79
-    JSONObject entry = filePlugin.getEntryForFile(file);
80
-
81
-#### iOS
82
-
83
-Cordova on iOS does not use the same `CordovaResourceApi` concept as Android. On iOS, you should use the File plugin to convert between URLs and filesystem paths.
84
-
85
-    // Get a CDVFilesystem URL object from a URL string
86
-    CDVFilesystemURL* url = [CDVFilesystemURL fileSystemURLWithString:cdvfileURL];
87
-    // Get a path for the URL object, or nil if it cannot be mapped to a file
88
-    NSString* path = [filePlugin filesystemPathForURL:url];
89
-    
90
-
91
-    // Get a CDVFilesystem URL object for a device path, or
92
-    // nil if it cannot be represented as a cdvfile URL.
93
-    CDVFilesystemURL* url = [filePlugin fileSystemURLforLocalPath:path];
94
-    // Get the string representation of the URL object
95
-    NSString* cdvfileURL = [url absoluteString];
96
-
97
-If your plugin creates a file, and you want to return a FileEntry object for it, use the File plugin:
98
-
99
-    // Get a CDVFilesystem URL object for a device path, or
100
-    // nil if it cannot be represented as a cdvfile URL.
101
-    CDVFilesystemURL* url = [filePlugin fileSystemURLforLocalPath:path];
102
-    // Get a structure to return to JavaScript
103
-    NSDictionary* entry = [filePlugin makeEntryForLocalURL:url]
104
-
105
-#### JavaScript
106
-
107
-In JavaScript, to get a `cdvfile://` URL from a FileEntry or DirectoryEntry object, simply call `.toURL()` on it:
108
-
109
-    var cdvfileURL = entry.toURL();
110
-
111
-In plugin response handlers, to convert from a returned FileEntry structure to an actual Entry object, your handler code should import the File plugin and create a new object:
112
-
113
-    // create appropriate Entry object
114
-    var entry;
115
-    if (entryStruct.isDirectory) {
116
-        entry = new DirectoryEntry(entryStruct.name, entryStruct.fullPath, new FileSystem(entryStruct.filesystemName));
117
-    } else {
118
-        entry = new FileEntry(entryStruct.name, entryStruct.fullPath, new FileSystem(entryStruct.filesystemName));
119
-    }
120
-

+ 0
- 87
node_modules/cordova-plugin-file/package.json Datei anzeigen

@@ -1,87 +0,0 @@
1
-{
2
-  "_from": "cordova-plugin-file@6.0.2",
3
-  "_id": "cordova-plugin-file@6.0.2",
4
-  "_inBundle": false,
5
-  "_integrity": "sha512-m7cughw327CjONN/qjzsTpSesLaeybksQh420/gRuSXJX5Zt9NfgsSbqqKDon6jnQ9Mm7h7imgyO2uJ34XMBtA==",
6
-  "_location": "/cordova-plugin-file",
7
-  "_phantomChildren": {},
8
-  "_requested": {
9
-    "type": "version",
10
-    "registry": true,
11
-    "raw": "cordova-plugin-file@6.0.2",
12
-    "name": "cordova-plugin-file",
13
-    "escapedName": "cordova-plugin-file",
14
-    "rawSpec": "6.0.2",
15
-    "saveSpec": null,
16
-    "fetchSpec": "6.0.2"
17
-  },
18
-  "_requiredBy": [
19
-    "#DEV:/",
20
-    "#USER"
21
-  ],
22
-  "_resolved": "https://registry.npmjs.org/cordova-plugin-file/-/cordova-plugin-file-6.0.2.tgz",
23
-  "_shasum": "f3911479f8357e9aacb5576674f8d95b31a1fb20",
24
-  "_spec": "cordova-plugin-file@6.0.2",
25
-  "_where": "/Users/christian/Documents/artesanias",
26
-  "author": {
27
-    "name": "Apache Software Foundation"
28
-  },
29
-  "bugs": {
30
-    "url": "https://github.com/apache/cordova-plugin-file/issues"
31
-  },
32
-  "bundleDependencies": false,
33
-  "cordova": {
34
-    "id": "cordova-plugin-file",
35
-    "platforms": [
36
-      "android",
37
-      "browser",
38
-      "ios",
39
-      "osx",
40
-      "windows"
41
-    ]
42
-  },
43
-  "deprecated": false,
44
-  "description": "Cordova File Plugin",
45
-  "devDependencies": {
46
-    "eslint": "^3.19.0",
47
-    "eslint-config-semistandard": "^11.0.0",
48
-    "eslint-config-standard": "^10.2.1",
49
-    "eslint-plugin-import": "^2.3.0",
50
-    "eslint-plugin-node": "^5.0.0",
51
-    "eslint-plugin-promise": "^3.5.0",
52
-    "eslint-plugin-standard": "^3.0.1"
53
-  },
54
-  "engines": {
55
-    "cordovaDependencies": {
56
-      "5.0.0": {
57
-        "cordova-android": ">=6.3.0"
58
-      },
59
-      "7.0.0": {
60
-        "cordova": ">100"
61
-      }
62
-    }
63
-  },
64
-  "homepage": "https://github.com/apache/cordova-plugin-file#readme",
65
-  "keywords": [
66
-    "cordova",
67
-    "file",
68
-    "ecosystem:cordova",
69
-    "cordova-android",
70
-    "cordova-browser",
71
-    "cordova-ios",
72
-    "cordova-osx",
73
-    "cordova-windows"
74
-  ],
75
-  "license": "Apache-2.0",
76
-  "name": "cordova-plugin-file",
77
-  "repository": {
78
-    "type": "git",
79
-    "url": "git+https://github.com/apache/cordova-plugin-file.git"
80
-  },
81
-  "scripts": {
82
-    "eslint": "node node_modules/eslint/bin/eslint www && node node_modules/eslint/bin/eslint src && node node_modules/eslint/bin/eslint tests",
83
-    "test": "npm run eslint"
84
-  },
85
-  "types": "./types/index.d.ts",
86
-  "version": "6.0.2"
87
-}

+ 0
- 260
node_modules/cordova-plugin-file/plugin.xml Datei anzeigen

@@ -1,260 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<!--
3
-  Licensed to the Apache Software Foundation (ASF) under one
4
-  or more contributor license agreements.  See the NOTICE file
5
-  distributed with this work for additional information
6
-  regarding copyright ownership.  The ASF licenses this file
7
-  to you under the Apache License, Version 2.0 (the
8
-  "License"); you may not use this file except in compliance
9
-  with the License.  You may obtain a copy of the License at
10
-
11
-    http://www.apache.org/licenses/LICENSE-2.0
12
-
13
-  Unless required by applicable law or agreed to in writing,
14
-  software distributed under the License is distributed on an
15
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
-  KIND, either express or implied.  See the License for the
17
-  specific language governing permissions and limitations
18
-  under the License.
19
--->
20
-
21
-<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
22
-xmlns:android="http://schemas.android.com/apk/res/android"
23
-           id="cordova-plugin-file"
24
-      version="6.0.2">
25
-    <name>File</name>
26
-    <description>Cordova File Plugin</description>
27
-    <license>Apache 2.0</license>
28
-    <keywords>cordova,file</keywords>
29
-    <repo>https://github.com/apache/cordova-plugin-file</repo>
30
-    <issue>https://github.com/apache/cordova-plugin-file/issues</issue>
31
-
32
-    <engines>
33
-        <engine name="cordova-android" version=">=6.3.0" />
34
-    </engines>
35
-
36
-    <js-module src="www/DirectoryEntry.js" name="DirectoryEntry">
37
-        <clobbers target="window.DirectoryEntry" />
38
-    </js-module>
39
-
40
-    <js-module src="www/DirectoryReader.js" name="DirectoryReader">
41
-        <clobbers target="window.DirectoryReader" />
42
-    </js-module>
43
-
44
-    <js-module src="www/Entry.js" name="Entry">
45
-        <clobbers target="window.Entry" />
46
-    </js-module>
47
-
48
-    <js-module src="www/File.js" name="File">
49
-        <clobbers target="window.File" />
50
-    </js-module>
51
-
52
-    <js-module src="www/FileEntry.js" name="FileEntry">
53
-        <clobbers target="window.FileEntry" />
54
-    </js-module>
55
-
56
-    <js-module src="www/FileError.js" name="FileError">
57
-        <clobbers target="window.FileError" />
58
-    </js-module>
59
-
60
-    <js-module src="www/FileReader.js" name="FileReader">
61
-        <clobbers target="window.FileReader" />
62
-    </js-module>
63
-
64
-    <js-module src="www/FileSystem.js" name="FileSystem">
65
-        <clobbers target="window.FileSystem" />
66
-    </js-module>
67
-
68
-    <js-module src="www/FileUploadOptions.js" name="FileUploadOptions">
69
-        <clobbers target="window.FileUploadOptions" />
70
-    </js-module>
71
-
72
-    <js-module src="www/FileUploadResult.js" name="FileUploadResult">
73
-        <clobbers target="window.FileUploadResult" />
74
-    </js-module>
75
-
76
-    <js-module src="www/FileWriter.js" name="FileWriter">
77
-        <clobbers target="window.FileWriter" />
78
-    </js-module>
79
-
80
-    <js-module src="www/Flags.js" name="Flags">
81
-        <clobbers target="window.Flags" />
82
-    </js-module>
83
-
84
-    <js-module src="www/LocalFileSystem.js" name="LocalFileSystem">
85
-        <!-- Non-standards way -->
86
-        <clobbers target="window.LocalFileSystem" />
87
-        <!-- Standards-compliant way -->
88
-        <merges target="window" />
89
-    </js-module>
90
-
91
-    <js-module src="www/Metadata.js" name="Metadata">
92
-        <clobbers target="window.Metadata" />
93
-    </js-module>
94
-
95
-    <js-module src="www/ProgressEvent.js" name="ProgressEvent">
96
-        <clobbers target="window.ProgressEvent" />
97
-    </js-module>
98
-
99
-    <js-module src="www/fileSystems.js" name="fileSystems" />
100
-
101
-    <js-module src="www/requestFileSystem.js" name="requestFileSystem">
102
-        <clobbers target="window.requestFileSystem" />
103
-    </js-module>
104
-
105
-    <js-module src="www/resolveLocalFileSystemURI.js" name="resolveLocalFileSystemURI">
106
-        <merges target="window" />
107
-    </js-module>
108
-
109
-    <!-- Required for browserify: we always link module below as there is conditional reference
110
-    to this module from requestFileSystem and resolveLocalFileSystemURI modules. -->
111
-    <js-module src="www/browser/isChrome.js" name="isChrome">
112
-        <runs />
113
-    </js-module>
114
-
115
-    <!-- android -->
116
-    <platform name="android">
117
-        <info>
118
-The Android Persistent storage location now defaults to "Internal". Please check this plugin's README to see if your application needs any changes in its config.xml.
119
-
120
-If this is a new application no changes are required.
121
-
122
-If this is an update to an existing application that did not specify an "AndroidPersistentFileLocation" you may need to add:
123
-
124
-      "&lt;preference name="AndroidPersistentFileLocation" value="Compatibility" /&gt;"
125
-
126
-to config.xml in order for the application to find previously stored files.
127
-        </info>
128
-        <config-file target="res/xml/config.xml" parent="/*">
129
-            <feature name="File" >
130
-                <param name="android-package" value="org.apache.cordova.file.FileUtils"/>
131
-                <param name="onload" value="true" />
132
-            </feature>
133
-            <allow-navigation href="cdvfile:*" />
134
-        </config-file>
135
-
136
-        <config-file target="AndroidManifest.xml" parent="/*">
137
-            <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
138
-        </config-file>
139
-
140
-        <source-file src="src/android/EncodingException.java" target-dir="src/org/apache/cordova/file" />
141
-        <source-file src="src/android/FileExistsException.java" target-dir="src/org/apache/cordova/file" />
142
-        <source-file src="src/android/InvalidModificationException.java" target-dir="src/org/apache/cordova/file" />
143
-        <source-file src="src/android/NoModificationAllowedException.java" target-dir="src/org/apache/cordova/file" />
144
-        <source-file src="src/android/TypeMismatchException.java" target-dir="src/org/apache/cordova/file" />
145
-        <source-file src="src/android/FileUtils.java" target-dir="src/org/apache/cordova/file" />
146
-        <source-file src="src/android/DirectoryManager.java" target-dir="src/org/apache/cordova/file" />
147
-        <source-file src="src/android/LocalFilesystemURL.java" target-dir="src/org/apache/cordova/file" />
148
-        <source-file src="src/android/Filesystem.java" target-dir="src/org/apache/cordova/file" />
149
-        <source-file src="src/android/LocalFilesystem.java" target-dir="src/org/apache/cordova/file" />
150
-        <source-file src="src/android/ContentFilesystem.java" target-dir="src/org/apache/cordova/file" />
151
-        <source-file src="src/android/AssetFilesystem.java" target-dir="src/org/apache/cordova/file" />
152
-        <source-file src="src/android/PendingRequests.java" target-dir="src/org/apache/cordova/file" />
153
-
154
-        <!-- android specific file apis -->
155
-        <js-module src="www/android/FileSystem.js" name="androidFileSystem">
156
-            <merges target="FileSystem" />
157
-        </js-module>
158
-        <js-module src="www/fileSystems-roots.js" name="fileSystems-roots">
159
-            <runs/>
160
-        </js-module>
161
-        <js-module src="www/fileSystemPaths.js" name="fileSystemPaths">
162
-            <merges target="cordova" />
163
-            <runs/>
164
-        </js-module>
165
-    </platform>
166
-
167
-    <!-- ios -->
168
-    <platform name="ios">
169
-        <config-file target="config.xml" parent="/*">
170
-            <feature name="File">
171
-                <param name="ios-package" value="CDVFile" />
172
-                <param name="onload" value="true" />
173
-            </feature>
174
-        </config-file>
175
-        <header-file src="src/ios/CDVFile.h" />
176
-        <source-file src="src/ios/CDVFile.m" />
177
-        <header-file src="src/ios/CDVLocalFilesystem.h" />
178
-        <source-file src="src/ios/CDVLocalFilesystem.m" />
179
-        <header-file src="src/ios/CDVAssetLibraryFilesystem.h" />
180
-        <source-file src="src/ios/CDVAssetLibraryFilesystem.m" />
181
-
182
-        <!-- ios specific file apis -->
183
-        <js-module src="www/ios/FileSystem.js" name="iosFileSystem">
184
-            <merges target="FileSystem" />
185
-        </js-module>
186
-
187
-        <js-module src="www/fileSystems-roots.js" name="fileSystems-roots">
188
-            <runs/>
189
-        </js-module>
190
-
191
-        <js-module src="www/fileSystemPaths.js" name="fileSystemPaths">
192
-            <merges target="cordova" />
193
-            <runs/>
194
-        </js-module>
195
-
196
-        <framework src="AssetsLibrary.framework" />
197
-        <framework src="MobileCoreServices.framework" />
198
-    </platform>
199
-
200
-    <!-- osx -->
201
-    <platform name="osx">
202
-        <config-file target="config.xml" parent="/*">
203
-            <feature name="File">
204
-                <param name="ios-package" value="CDVFile" />
205
-                <param name="onload" value="true" />
206
-            </feature>
207
-        </config-file>
208
-        <header-file src="src/osx/CDVFile.h" />
209
-        <source-file src="src/osx/CDVFile.m" />
210
-        <header-file src="src/osx/CDVLocalFilesystem.h" />
211
-        <source-file src="src/osx/CDVLocalFilesystem.m" />
212
-
213
-        <!-- osx specific file apis -->
214
-        <js-module src="www/osx/FileSystem.js" name="osxFileSystem">
215
-            <merges target="FileSystem" />
216
-        </js-module>
217
-
218
-        <js-module src="www/fileSystems-roots.js" name="fileSystems-roots">
219
-            <runs/>
220
-        </js-module>
221
-
222
-        <js-module src="www/fileSystemPaths.js" name="fileSystemPaths">
223
-            <merges target="cordova" />
224
-            <runs/>
225
-        </js-module>
226
-    </platform>
227
-
228
-    <!-- windows -->
229
-    <platform name="windows">
230
-        <js-module src="src/windows/FileProxy.js" name="FileProxy">
231
-            <runs />
232
-        </js-module>
233
-
234
-        <js-module src="www/fileSystemPaths.js" name="fileSystemPaths">
235
-            <merges target="cordova" />
236
-            <runs/>
237
-        </js-module>
238
-    </platform>
239
-
240
-    <platform name="browser">
241
-        <!-- File for Chrome -->
242
-        <js-module src="www/browser/Preparing.js" name="Preparing">
243
-            <runs />
244
-        </js-module>
245
-
246
-        <js-module src="src/browser/FileProxy.js" name="browserFileProxy">
247
-            <runs />
248
-        </js-module>
249
-
250
-        <js-module src="www/fileSystemPaths.js" name="fileSystemPaths">
251
-            <merges target="cordova" />
252
-            <runs />
253
-        </js-module>
254
-
255
-        <js-module src="www/browser/FileSystem.js" name="firefoxFileSystem">
256
-            <merges target="window.FileSystem" />
257
-        </js-module>
258
-    </platform>
259
-
260
-</plugin>

+ 0
- 294
node_modules/cordova-plugin-file/src/android/AssetFilesystem.java Datei anzeigen

@@ -1,294 +0,0 @@
1
-/*
2
-       Licensed to the Apache Software Foundation (ASF) under one
3
-       or more contributor license agreements.  See the NOTICE file
4
-       distributed with this work for additional information
5
-       regarding copyright ownership.  The ASF licenses this file
6
-       to you under the Apache License, Version 2.0 (the
7
-       "License"); you may not use this file except in compliance
8
-       with the License.  You may obtain a copy of the License at
9
-
10
-         http://www.apache.org/licenses/LICENSE-2.0
11
-
12
-       Unless required by applicable law or agreed to in writing,
13
-       software distributed under the License is distributed on an
14
-       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
-       KIND, either express or implied.  See the License for the
16
-       specific language governing permissions and limitations
17
-       under the License.
18
- */
19
-package org.apache.cordova.file;
20
-
21
-import android.content.res.AssetManager;
22
-import android.net.Uri;
23
-
24
-import org.apache.cordova.CordovaResourceApi;
25
-import org.apache.cordova.LOG;
26
-import org.json.JSONArray;
27
-import org.json.JSONException;
28
-import org.json.JSONObject;
29
-
30
-import java.io.File;
31
-import java.io.FileNotFoundException;
32
-import java.io.IOException;
33
-import java.io.ObjectInputStream;
34
-import java.util.HashMap;
35
-import java.util.Map;
36
-
37
-public class AssetFilesystem extends Filesystem {
38
-
39
-    private final AssetManager assetManager;
40
-
41
-    // A custom gradle hook creates the cdvasset.manifest file, which speeds up asset listing a tonne.
42
-    // See: http://stackoverflow.com/questions/16911558/android-assetmanager-list-incredibly-slow
43
-    private static Object listCacheLock = new Object();
44
-    private static boolean listCacheFromFile;
45
-    private static Map<String, String[]> listCache;
46
-    private static Map<String, Long> lengthCache;
47
-
48
-    private static final String LOG_TAG = "AssetFilesystem";
49
-
50
-    private void lazyInitCaches() {
51
-        synchronized (listCacheLock) {
52
-            if (listCache == null) {
53
-                ObjectInputStream ois = null;
54
-                try {
55
-                    ois = new ObjectInputStream(assetManager.open("cdvasset.manifest"));
56
-                    listCache = (Map<String, String[]>) ois.readObject();
57
-                    lengthCache = (Map<String, Long>) ois.readObject();
58
-                    listCacheFromFile = true;
59
-                } catch (ClassNotFoundException e) {
60
-                    e.printStackTrace();
61
-                } catch (IOException e) {
62
-                    // Asset manifest won't exist if the gradle hook isn't set up correctly.
63
-                } finally {
64
-                    if (ois != null) {
65
-                        try {
66
-                            ois.close();
67
-                        } catch (IOException e) {
68
-                            LOG.d(LOG_TAG, e.getLocalizedMessage());
69
-                        }
70
-                    }
71
-                }
72
-                if (listCache == null) {
73
-                    LOG.w("AssetFilesystem", "Asset manifest not found. Recursive copies and directory listing will be slow.");
74
-                    listCache = new HashMap<String, String[]>();
75
-                }
76
-            }
77
-        }
78
-    }
79
-
80
-    private String[] listAssets(String assetPath) throws IOException {
81
-        if (assetPath.startsWith("/")) {
82
-            assetPath = assetPath.substring(1);
83
-        }
84
-        if (assetPath.endsWith("/")) {
85
-            assetPath = assetPath.substring(0, assetPath.length() - 1);
86
-        }
87
-        lazyInitCaches();
88
-        String[] ret = listCache.get(assetPath);
89
-        if (ret == null) {
90
-            if (listCacheFromFile) {
91
-                ret = new String[0];
92
-            } else {
93
-                ret = assetManager.list(assetPath);
94
-                listCache.put(assetPath, ret);
95
-            }
96
-        }
97
-        return ret;
98
-    }
99
-
100
-    private long getAssetSize(String assetPath) throws FileNotFoundException {
101
-        if (assetPath.startsWith("/")) {
102
-            assetPath = assetPath.substring(1);
103
-        }
104
-        lazyInitCaches();
105
-        if (lengthCache != null) {
106
-            Long ret = lengthCache.get(assetPath);
107
-            if (ret == null) {
108
-                throw new FileNotFoundException("Asset not found: " + assetPath);
109
-            }
110
-            return ret;
111
-        }
112
-        CordovaResourceApi.OpenForReadResult offr = null;
113
-        try {
114
-            offr = resourceApi.openForRead(nativeUriForFullPath(assetPath));
115
-            long length = offr.length;
116
-            if (length < 0) {
117
-                // available() doesn't always yield the file size, but for assets it does.
118
-                length = offr.inputStream.available();
119
-            }
120
-            return length;
121
-        } catch (IOException e) {
122
-            FileNotFoundException fnfe = new FileNotFoundException("File not found: " + assetPath);
123
-            fnfe.initCause(e);
124
-            throw fnfe;
125
-        } finally {
126
-            if (offr != null) {
127
-                try {
128
-                    offr.inputStream.close();
129
-                } catch (IOException e) {
130
-                    LOG.d(LOG_TAG, e.getLocalizedMessage());
131
-                }
132
-            }
133
-        }
134
-    }
135
-
136
-    public AssetFilesystem(AssetManager assetManager, CordovaResourceApi resourceApi) {
137
-        super(Uri.parse("file:///android_asset/"), "assets", resourceApi);
138
-        this.assetManager = assetManager;
139
-	}
140
-
141
-    @Override
142
-    public Uri toNativeUri(LocalFilesystemURL inputURL) {
143
-        return nativeUriForFullPath(inputURL.path);
144
-    }
145
-
146
-    @Override
147
-    public LocalFilesystemURL toLocalUri(Uri inputURL) {
148
-        if (!"file".equals(inputURL.getScheme())) {
149
-            return null;
150
-        }
151
-        File f = new File(inputURL.getPath());
152
-        // Removes and duplicate /s (e.g. file:///a//b/c)
153
-        Uri resolvedUri = Uri.fromFile(f);
154
-        String rootUriNoTrailingSlash = rootUri.getEncodedPath();
155
-        rootUriNoTrailingSlash = rootUriNoTrailingSlash.substring(0, rootUriNoTrailingSlash.length() - 1);
156
-        if (!resolvedUri.getEncodedPath().startsWith(rootUriNoTrailingSlash)) {
157
-            return null;
158
-        }
159
-        String subPath = resolvedUri.getEncodedPath().substring(rootUriNoTrailingSlash.length());
160
-        // Strip leading slash
161
-        if (!subPath.isEmpty()) {
162
-            subPath = subPath.substring(1);
163
-        }
164
-        Uri.Builder b = new Uri.Builder()
165
-            .scheme(LocalFilesystemURL.FILESYSTEM_PROTOCOL)
166
-            .authority("localhost")
167
-            .path(name);
168
-        if (!subPath.isEmpty()) {
169
-            b.appendEncodedPath(subPath);
170
-        }
171
-        if (isDirectory(subPath) || inputURL.getPath().endsWith("/")) {
172
-            // Add trailing / for directories.
173
-            b.appendEncodedPath("");
174
-        }
175
-        return LocalFilesystemURL.parse(b.build());
176
-    }
177
-
178
-    private boolean isDirectory(String assetPath) {
179
-        try {
180
-            return listAssets(assetPath).length != 0;
181
-        } catch (IOException e) {
182
-            return false;
183
-        }
184
-    }
185
-
186
-    @Override
187
-    public LocalFilesystemURL[] listChildren(LocalFilesystemURL inputURL) throws FileNotFoundException {
188
-        String pathNoSlashes = inputURL.path.substring(1);
189
-        if (pathNoSlashes.endsWith("/")) {
190
-            pathNoSlashes = pathNoSlashes.substring(0, pathNoSlashes.length() - 1);
191
-        }
192
-
193
-        String[] files;
194
-        try {
195
-            files = listAssets(pathNoSlashes);
196
-        } catch (IOException e) {
197
-            FileNotFoundException fnfe = new FileNotFoundException();
198
-            fnfe.initCause(e);
199
-            throw fnfe;
200
-        }
201
-
202
-        LocalFilesystemURL[] entries = new LocalFilesystemURL[files.length];
203
-        for (int i = 0; i < files.length; ++i) {
204
-            entries[i] = localUrlforFullPath(new File(inputURL.path, files[i]).getPath());
205
-        }
206
-        return entries;
207
-	}
208
-
209
-    @Override
210
-    public JSONObject getFileForLocalURL(LocalFilesystemURL inputURL,
211
-                                         String path, JSONObject options, boolean directory)
212
-            throws FileExistsException, IOException, TypeMismatchException, EncodingException, JSONException {
213
-        if (options != null && options.optBoolean("create")) {
214
-            throw new UnsupportedOperationException("Assets are read-only");
215
-        }
216
-
217
-        // Check whether the supplied path is absolute or relative
218
-        if (directory && !path.endsWith("/")) {
219
-            path += "/";
220
-        }
221
-
222
-        LocalFilesystemURL requestedURL;
223
-        if (path.startsWith("/")) {
224
-            requestedURL = localUrlforFullPath(normalizePath(path));
225
-        } else {
226
-            requestedURL = localUrlforFullPath(normalizePath(inputURL.path + "/" + path));
227
-        }
228
-
229
-        // Throws a FileNotFoundException if it doesn't exist.
230
-        getFileMetadataForLocalURL(requestedURL);
231
-
232
-        boolean isDir = isDirectory(requestedURL.path);
233
-        if (directory && !isDir) {
234
-            throw new TypeMismatchException("path doesn't exist or is file");
235
-        } else if (!directory && isDir) {
236
-            throw new TypeMismatchException("path doesn't exist or is directory");
237
-        }
238
-
239
-        // Return the directory
240
-        return makeEntryForURL(requestedURL);
241
-    }
242
-
243
-    @Override
244
-	public JSONObject getFileMetadataForLocalURL(LocalFilesystemURL inputURL) throws FileNotFoundException {
245
-        JSONObject metadata = new JSONObject();
246
-        long size = inputURL.isDirectory ? 0 : getAssetSize(inputURL.path);
247
-        try {
248
-        	metadata.put("size", size);
249
-        	metadata.put("type", inputURL.isDirectory ? "text/directory" : resourceApi.getMimeType(toNativeUri(inputURL)));
250
-        	metadata.put("name", new File(inputURL.path).getName());
251
-        	metadata.put("fullPath", inputURL.path);
252
-        	metadata.put("lastModifiedDate", 0);
253
-        } catch (JSONException e) {
254
-            return null;
255
-        }
256
-        return metadata;
257
-	}
258
-
259
-	@Override
260
-	public boolean canRemoveFileAtLocalURL(LocalFilesystemURL inputURL) {
261
-		return false;
262
-	}
263
-
264
-    @Override
265
-    long writeToFileAtURL(LocalFilesystemURL inputURL, String data, int offset, boolean isBinary) throws NoModificationAllowedException, IOException {
266
-        throw new NoModificationAllowedException("Assets are read-only");
267
-    }
268
-
269
-    @Override
270
-    long truncateFileAtURL(LocalFilesystemURL inputURL, long size) throws IOException, NoModificationAllowedException {
271
-        throw new NoModificationAllowedException("Assets are read-only");
272
-    }
273
-
274
-    @Override
275
-    String filesystemPathForURL(LocalFilesystemURL url) {
276
-        return new File(rootUri.getPath(), url.path).toString();
277
-    }
278
-
279
-    @Override
280
-    LocalFilesystemURL URLforFilesystemPath(String path) {
281
-        return null;
282
-    }
283
-
284
-    @Override
285
-    boolean removeFileAtLocalURL(LocalFilesystemURL inputURL) throws InvalidModificationException, NoModificationAllowedException {
286
-        throw new NoModificationAllowedException("Assets are read-only");
287
-    }
288
-
289
-    @Override
290
-    boolean recursiveRemoveFileAtLocalURL(LocalFilesystemURL inputURL) throws NoModificationAllowedException {
291
-        throw new NoModificationAllowedException("Assets are read-only");
292
-    }
293
-
294
-}

+ 0
- 223
node_modules/cordova-plugin-file/src/android/ContentFilesystem.java Datei anzeigen

@@ -1,223 +0,0 @@
1
-/*
2
-       Licensed to the Apache Software Foundation (ASF) under one
3
-       or more contributor license agreements.  See the NOTICE file
4
-       distributed with this work for additional information
5
-       regarding copyright ownership.  The ASF licenses this file
6
-       to you under the Apache License, Version 2.0 (the
7
-       "License"); you may not use this file except in compliance
8
-       with the License.  You may obtain a copy of the License at
9
-
10
-         http://www.apache.org/licenses/LICENSE-2.0
11
-
12
-       Unless required by applicable law or agreed to in writing,
13
-       software distributed under the License is distributed on an
14
-       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
-       KIND, either express or implied.  See the License for the
16
-       specific language governing permissions and limitations
17
-       under the License.
18
- */
19
-package org.apache.cordova.file;
20
-
21
-import android.content.ContentResolver;
22
-import android.content.Context;
23
-import android.database.Cursor;
24
-import android.net.Uri;
25
-import android.provider.DocumentsContract;
26
-import android.provider.MediaStore;
27
-import android.provider.OpenableColumns;
28
-import java.io.File;
29
-import java.io.FileNotFoundException;
30
-import java.io.IOException;
31
-import org.apache.cordova.CordovaResourceApi;
32
-import org.json.JSONException;
33
-import org.json.JSONObject;
34
-
35
-public class ContentFilesystem extends Filesystem {
36
-
37
-    private final Context context;
38
-
39
-	public ContentFilesystem(Context context, CordovaResourceApi resourceApi) {
40
-		super(Uri.parse("content://"), "content", resourceApi);
41
-        this.context = context;
42
-	}
43
-
44
-    @Override
45
-    public Uri toNativeUri(LocalFilesystemURL inputURL) {
46
-        String authorityAndPath = inputURL.uri.getEncodedPath().substring(this.name.length() + 2);
47
-        if (authorityAndPath.length() < 2) {
48
-            return null;
49
-        }
50
-        String ret = "content://" + authorityAndPath;
51
-        String query = inputURL.uri.getEncodedQuery();
52
-        if (query != null) {
53
-            ret += '?' + query;
54
-        }
55
-        String frag = inputURL.uri.getEncodedFragment();
56
-        if (frag != null) {
57
-            ret += '#' + frag;
58
-        }
59
-        return Uri.parse(ret);
60
-    }
61
-
62
-    @Override
63
-    public LocalFilesystemURL toLocalUri(Uri inputURL) {
64
-        if (!"content".equals(inputURL.getScheme())) {
65
-            return null;
66
-        }
67
-        String subPath = inputURL.getEncodedPath();
68
-        if (subPath.length() > 0) {
69
-            subPath = subPath.substring(1);
70
-        }
71
-        Uri.Builder b = new Uri.Builder()
72
-            .scheme(LocalFilesystemURL.FILESYSTEM_PROTOCOL)
73
-            .authority("localhost")
74
-            .path(name)
75
-            .appendPath(inputURL.getAuthority());
76
-        if (subPath.length() > 0) {
77
-            b.appendEncodedPath(subPath);
78
-        }
79
-        Uri localUri = b.encodedQuery(inputURL.getEncodedQuery())
80
-            .encodedFragment(inputURL.getEncodedFragment())
81
-            .build();
82
-        return LocalFilesystemURL.parse(localUri);
83
-    }
84
-
85
-    @Override
86
-	public JSONObject getFileForLocalURL(LocalFilesystemURL inputURL,
87
-			String fileName, JSONObject options, boolean directory) throws IOException, TypeMismatchException, JSONException {
88
-        throw new UnsupportedOperationException("getFile() not supported for content:. Use resolveLocalFileSystemURL instead.");
89
-	}
90
-
91
-	@Override
92
-	public boolean removeFileAtLocalURL(LocalFilesystemURL inputURL)
93
-			throws NoModificationAllowedException {
94
-        Uri contentUri = toNativeUri(inputURL);
95
-		try {
96
-            context.getContentResolver().delete(contentUri, null, null);
97
-		} catch (UnsupportedOperationException t) {
98
-			// Was seeing this on the File mobile-spec tests on 4.0.3 x86 emulator.
99
-			// The ContentResolver applies only when the file was registered in the
100
-			// first case, which is generally only the case with images.
101
-            NoModificationAllowedException nmae = new NoModificationAllowedException("Deleting not supported for content uri: " + contentUri);
102
-            nmae.initCause(t);
103
-            throw nmae;
104
-		}
105
-        return true;
106
-	}
107
-
108
-	@Override
109
-	public boolean recursiveRemoveFileAtLocalURL(LocalFilesystemURL inputURL)
110
-			throws NoModificationAllowedException {
111
-		throw new NoModificationAllowedException("Cannot remove content url");
112
-	}
113
-
114
-    @Override
115
-    public LocalFilesystemURL[] listChildren(LocalFilesystemURL inputURL) throws FileNotFoundException {
116
-        throw new UnsupportedOperationException("readEntriesAtLocalURL() not supported for content:. Use resolveLocalFileSystemURL instead.");
117
-    }
118
-
119
-	@Override
120
-	public JSONObject getFileMetadataForLocalURL(LocalFilesystemURL inputURL) throws FileNotFoundException {
121
-        long size = -1;
122
-        long lastModified = 0;
123
-        Uri nativeUri = toNativeUri(inputURL);
124
-        String mimeType = resourceApi.getMimeType(nativeUri);
125
-        Cursor cursor = openCursorForURL(nativeUri);
126
-        try {
127
-            if (cursor != null && cursor.moveToFirst()) {
128
-                Long sizeForCursor = resourceSizeForCursor(cursor);
129
-                if (sizeForCursor != null) {
130
-                    size = sizeForCursor.longValue();
131
-                }
132
-                Long modified = lastModifiedDateForCursor(cursor);
133
-                if (modified != null)
134
-                    lastModified = modified.longValue();
135
-            } else {
136
-                // Some content providers don't support cursors at all!
137
-                CordovaResourceApi.OpenForReadResult offr = resourceApi.openForRead(nativeUri);
138
-                size = offr.length;
139
-            }
140
-        } catch (IOException e) {
141
-            FileNotFoundException fnfe = new FileNotFoundException();
142
-            fnfe.initCause(e);
143
-            throw fnfe;
144
-        } finally {
145
-        	if (cursor != null)
146
-        		cursor.close();
147
-        }
148
-
149
-        JSONObject metadata = new JSONObject();
150
-        try {
151
-        	metadata.put("size", size);
152
-        	metadata.put("type", mimeType);
153
-        	metadata.put("name", name);
154
-        	metadata.put("fullPath", inputURL.path);
155
-        	metadata.put("lastModifiedDate", lastModified);
156
-        } catch (JSONException e) {
157
-        	return null;
158
-        }
159
-        return metadata;
160
-	}
161
-
162
-	@Override
163
-	public long writeToFileAtURL(LocalFilesystemURL inputURL, String data,
164
-			int offset, boolean isBinary) throws NoModificationAllowedException {
165
-        throw new NoModificationAllowedException("Couldn't write to file given its content URI");
166
-    }
167
-	@Override
168
-	public long truncateFileAtURL(LocalFilesystemURL inputURL, long size)
169
-			throws NoModificationAllowedException {
170
-        throw new NoModificationAllowedException("Couldn't truncate file given its content URI");
171
-	}
172
-
173
-	protected Cursor openCursorForURL(Uri nativeUri) {
174
-        ContentResolver contentResolver = context.getContentResolver();
175
-        try {
176
-            return contentResolver.query(nativeUri, null, null, null, null);
177
-        } catch (UnsupportedOperationException e) {
178
-            return null;
179
-        }
180
-	}
181
-
182
-	private Long resourceSizeForCursor(Cursor cursor) {
183
-        int columnIndex = cursor.getColumnIndex(OpenableColumns.SIZE);
184
-        if (columnIndex != -1) {
185
-            String sizeStr = cursor.getString(columnIndex);
186
-            if (sizeStr != null) {
187
-            	return Long.parseLong(sizeStr);
188
-            }
189
-        }
190
-        return null;
191
-	}
192
-	
193
-	protected Long lastModifiedDateForCursor(Cursor cursor) {
194
-        int columnIndex = cursor.getColumnIndex(MediaStore.MediaColumns.DATE_MODIFIED);
195
-        if (columnIndex == -1) {
196
-            columnIndex = cursor.getColumnIndex(DocumentsContract.Document.COLUMN_LAST_MODIFIED);
197
-        }
198
-        if (columnIndex != -1) {
199
-            String dateStr = cursor.getString(columnIndex);
200
-            if (dateStr != null) {
201
-                return Long.parseLong(dateStr);
202
-            }
203
-        }
204
-        return null;
205
-	}
206
-
207
-    @Override
208
-    public String filesystemPathForURL(LocalFilesystemURL url) {
209
-        File f = resourceApi.mapUriToFile(toNativeUri(url));
210
-        return f == null ? null : f.getAbsolutePath();
211
-    }
212
-
213
-	@Override
214
-	public LocalFilesystemURL URLforFilesystemPath(String path) {
215
-		// Returns null as we don't support reverse mapping back to content:// URLs
216
-		return null;
217
-	}
218
-
219
-	@Override
220
-	public boolean canRemoveFileAtLocalURL(LocalFilesystemURL inputURL) {
221
-		return true;
222
-	}
223
-}

+ 0
- 134
node_modules/cordova-plugin-file/src/android/DirectoryManager.java Datei anzeigen

@@ -1,134 +0,0 @@
1
-/*
2
-       Licensed to the Apache Software Foundation (ASF) under one
3
-       or more contributor license agreements.  See the NOTICE file
4
-       distributed with this work for additional information
5
-       regarding copyright ownership.  The ASF licenses this file
6
-       to you under the Apache License, Version 2.0 (the
7
-       "License"); you may not use this file except in compliance
8
-       with the License.  You may obtain a copy of the License at
9
-
10
-         http://www.apache.org/licenses/LICENSE-2.0
11
-
12
-       Unless required by applicable law or agreed to in writing,
13
-       software distributed under the License is distributed on an
14
-       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
-       KIND, either express or implied.  See the License for the
16
-       specific language governing permissions and limitations
17
-       under the License.
18
-*/
19
-package org.apache.cordova.file;
20
-
21
-import android.os.Environment;
22
-import android.os.StatFs;
23
-
24
-import java.io.File;
25
-
26
-/**
27
- * This class provides file directory utilities.
28
- * All file operations are performed on the SD card.
29
- *
30
- * It is used by the FileUtils class.
31
- */
32
-public class DirectoryManager {
33
-
34
-    @SuppressWarnings("unused")
35
-    private static final String LOG_TAG = "DirectoryManager";
36
-
37
-    /**
38
-     * Determine if a file or directory exists.
39
-     * @param name				The name of the file to check.
40
-     * @return					T=exists, F=not found
41
-     */
42
-    public static boolean testFileExists(String name) {
43
-        boolean status;
44
-
45
-        // If SD card exists
46
-        if ((testSaveLocationExists()) && (!name.equals(""))) {
47
-            File path = Environment.getExternalStorageDirectory();
48
-            File newPath = constructFilePaths(path.toString(), name);
49
-            status = newPath.exists();
50
-        }
51
-        // If no SD card
52
-        else {
53
-            status = false;
54
-        }
55
-        return status;
56
-    }
57
-
58
-    /**
59
-     * Get the free space in external storage
60
-     *
61
-     * @return 		Size in KB or -1 if not available
62
-     */
63
-    public static long getFreeExternalStorageSpace() {
64
-        String status = Environment.getExternalStorageState();
65
-        long freeSpaceInBytes = 0;
66
-
67
-        // Check if external storage exists
68
-        if (status.equals(Environment.MEDIA_MOUNTED)) {
69
-            freeSpaceInBytes = getFreeSpaceInBytes(Environment.getExternalStorageDirectory().getPath());
70
-        } else {
71
-            // If no external storage then return -1
72
-            return -1;
73
-        }
74
-
75
-        return freeSpaceInBytes / 1024;
76
-    }
77
-
78
-    /**
79
-     * Given a path return the number of free bytes in the filesystem containing the path.
80
-     *
81
-     * @param path to the file system
82
-     * @return free space in bytes
83
-     */
84
-    public static long getFreeSpaceInBytes(String path) {
85
-        try {
86
-            StatFs stat = new StatFs(path);
87
-            long blockSize = stat.getBlockSize();
88
-            long availableBlocks = stat.getAvailableBlocks();
89
-            return availableBlocks * blockSize;
90
-        } catch (IllegalArgumentException e) {
91
-            // The path was invalid. Just return 0 free bytes.
92
-            return 0;
93
-        }
94
-    }
95
-
96
-    /**
97
-     * Determine if SD card exists.
98
-     *
99
-     * @return				T=exists, F=not found
100
-     */
101
-    public static boolean testSaveLocationExists() {
102
-        String sDCardStatus = Environment.getExternalStorageState();
103
-        boolean status;
104
-
105
-        // If SD card is mounted
106
-        if (sDCardStatus.equals(Environment.MEDIA_MOUNTED)) {
107
-            status = true;
108
-        }
109
-
110
-        // If no SD card
111
-        else {
112
-            status = false;
113
-        }
114
-        return status;
115
-    }
116
-
117
-    /**
118
-     * Create a new file object from two file paths.
119
-     *
120
-     * @param file1			Base file path
121
-     * @param file2			Remaining file path
122
-     * @return				File object
123
-     */
124
-    private static File constructFilePaths (String file1, String file2) {
125
-        File newPath;
126
-        if (file2.startsWith(file1)) {
127
-            newPath = new File(file2);
128
-        }
129
-        else {
130
-            newPath = new File(file1 + "/" + file2);
131
-        }
132
-        return newPath;
133
-    }
134
-}

+ 0
- 29
node_modules/cordova-plugin-file/src/android/EncodingException.java Datei anzeigen

@@ -1,29 +0,0 @@
1
-/*
2
-       Licensed to the Apache Software Foundation (ASF) under one
3
-       or more contributor license agreements.  See the NOTICE file
4
-       distributed with this work for additional information
5
-       regarding copyright ownership.  The ASF licenses this file
6
-       to you under the Apache License, Version 2.0 (the
7
-       "License"); you may not use this file except in compliance
8
-       with the License.  You may obtain a copy of the License at
9
-
10
-         http://www.apache.org/licenses/LICENSE-2.0
11
-
12
-       Unless required by applicable law or agreed to in writing,
13
-       software distributed under the License is distributed on an
14
-       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
-       KIND, either express or implied.  See the License for the
16
-       specific language governing permissions and limitations
17
-       under the License.
18
-*/
19
-
20
-package org.apache.cordova.file;
21
-
22
-@SuppressWarnings("serial")
23
-public class EncodingException extends Exception {
24
-
25
-    public EncodingException(String message) {
26
-        super(message);
27
-    }
28
-
29
-}

+ 0
- 29
node_modules/cordova-plugin-file/src/android/FileExistsException.java Datei anzeigen

@@ -1,29 +0,0 @@
1
-/*
2
-       Licensed to the Apache Software Foundation (ASF) under one
3
-       or more contributor license agreements.  See the NOTICE file
4
-       distributed with this work for additional information
5
-       regarding copyright ownership.  The ASF licenses this file
6
-       to you under the Apache License, Version 2.0 (the
7
-       "License"); you may not use this file except in compliance
8
-       with the License.  You may obtain a copy of the License at
9
-
10
-         http://www.apache.org/licenses/LICENSE-2.0
11
-
12
-       Unless required by applicable law or agreed to in writing,
13
-       software distributed under the License is distributed on an
14
-       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
-       KIND, either express or implied.  See the License for the
16
-       specific language governing permissions and limitations
17
-       under the License.
18
-*/
19
-
20
-package org.apache.cordova.file;
21
-
22
-@SuppressWarnings("serial")
23
-public class FileExistsException extends Exception {
24
-
25
-    public FileExistsException(String msg) {
26
-        super(msg);
27
-    }
28
-
29
-}

+ 0
- 1225
node_modules/cordova-plugin-file/src/android/FileUtils.java
Datei-Diff unterdrückt, da er zu groß ist
Datei anzeigen


+ 0
- 331
node_modules/cordova-plugin-file/src/android/Filesystem.java Datei anzeigen

@@ -1,331 +0,0 @@
1
-/*
2
-       Licensed to the Apache Software Foundation (ASF) under one
3
-       or more contributor license agreements.  See the NOTICE file
4
-       distributed with this work for additional information
5
-       regarding copyright ownership.  The ASF licenses this file
6
-       to you under the Apache License, Version 2.0 (the
7
-       "License"); you may not use this file except in compliance
8
-       with the License.  You may obtain a copy of the License at
9
-
10
-         http://www.apache.org/licenses/LICENSE-2.0
11
-
12
-       Unless required by applicable law or agreed to in writing,
13
-       software distributed under the License is distributed on an
14
-       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
-       KIND, either express or implied.  See the License for the
16
-       specific language governing permissions and limitations
17
-       under the License.
18
- */
19
-package org.apache.cordova.file;
20
-
21
-import android.net.Uri;
22
-
23
-import java.io.File;
24
-import java.io.FileNotFoundException;
25
-import java.io.FilterInputStream;
26
-import java.io.IOException;
27
-import java.io.InputStream;
28
-import java.io.OutputStream;
29
-import java.util.ArrayList;
30
-import java.util.Arrays;
31
-
32
-import org.apache.cordova.CordovaResourceApi;
33
-import org.json.JSONArray;
34
-import org.json.JSONException;
35
-import org.json.JSONObject;
36
-
37
-public abstract class Filesystem {
38
-
39
-    protected final Uri rootUri;
40
-    protected final CordovaResourceApi resourceApi;
41
-    public final String name;
42
-    private JSONObject rootEntry;
43
-
44
-    public Filesystem(Uri rootUri, String name, CordovaResourceApi resourceApi) {
45
-        this.rootUri = rootUri;
46
-        this.name = name;
47
-        this.resourceApi = resourceApi;
48
-    }
49
-
50
-    public interface ReadFileCallback {
51
-		public void handleData(InputStream inputStream, String contentType) throws IOException;
52
-	}
53
-
54
-    public static JSONObject makeEntryForURL(LocalFilesystemURL inputURL, Uri nativeURL) {
55
-        try {
56
-            String path = inputURL.path;
57
-            int end = path.endsWith("/") ? 1 : 0;
58
-            String[] parts = path.substring(0, path.length() - end).split("/+");
59
-            String fileName = parts[parts.length - 1];
60
-
61
-            JSONObject entry = new JSONObject();
62
-            entry.put("isFile", !inputURL.isDirectory);
63
-            entry.put("isDirectory", inputURL.isDirectory);
64
-            entry.put("name", fileName);
65
-            entry.put("fullPath", path);
66
-            // The file system can't be specified, as it would lead to an infinite loop,
67
-            // but the filesystem name can be.
68
-            entry.put("filesystemName", inputURL.fsName);
69
-            // Backwards compatibility
70
-            entry.put("filesystem", "temporary".equals(inputURL.fsName) ? 0 : 1);
71
-
72
-            String nativeUrlStr = nativeURL.toString();
73
-            if (inputURL.isDirectory && !nativeUrlStr.endsWith("/")) {
74
-                nativeUrlStr += "/";
75
-            }
76
-            entry.put("nativeURL", nativeUrlStr);
77
-            return entry;
78
-        } catch (JSONException e) {
79
-            e.printStackTrace();
80
-            throw new RuntimeException(e);
81
-        }
82
-    }
83
-
84
-    public JSONObject makeEntryForURL(LocalFilesystemURL inputURL) {
85
-        Uri nativeUri = toNativeUri(inputURL);
86
-        return nativeUri == null ? null : makeEntryForURL(inputURL, nativeUri);
87
-    }
88
-
89
-    public JSONObject makeEntryForNativeUri(Uri nativeUri) {
90
-        LocalFilesystemURL inputUrl = toLocalUri(nativeUri);
91
-        return inputUrl == null ? null : makeEntryForURL(inputUrl, nativeUri);
92
-    }
93
-
94
-    public JSONObject getEntryForLocalURL(LocalFilesystemURL inputURL) throws IOException {
95
-        return makeEntryForURL(inputURL);
96
-    }
97
-
98
-    public JSONObject makeEntryForFile(File file) {
99
-        return makeEntryForNativeUri(Uri.fromFile(file));
100
-    }
101
-
102
-    abstract JSONObject getFileForLocalURL(LocalFilesystemURL inputURL, String path,
103
-			JSONObject options, boolean directory) throws FileExistsException, IOException, TypeMismatchException, EncodingException, JSONException;
104
-
105
-	abstract boolean removeFileAtLocalURL(LocalFilesystemURL inputURL) throws InvalidModificationException, NoModificationAllowedException;
106
-
107
-	abstract boolean recursiveRemoveFileAtLocalURL(LocalFilesystemURL inputURL) throws FileExistsException, NoModificationAllowedException;
108
-
109
-	abstract LocalFilesystemURL[] listChildren(LocalFilesystemURL inputURL) throws FileNotFoundException;
110
-
111
-    public final JSONArray readEntriesAtLocalURL(LocalFilesystemURL inputURL) throws FileNotFoundException {
112
-        LocalFilesystemURL[] children = listChildren(inputURL);
113
-        JSONArray entries = new JSONArray();
114
-        if (children != null) {
115
-            for (LocalFilesystemURL url : children) {
116
-                entries.put(makeEntryForURL(url));
117
-            }
118
-        }
119
-        return entries;
120
-    }
121
-
122
-	abstract JSONObject getFileMetadataForLocalURL(LocalFilesystemURL inputURL) throws FileNotFoundException;
123
-
124
-    public Uri getRootUri() {
125
-        return rootUri;
126
-    }
127
-
128
-    public boolean exists(LocalFilesystemURL inputURL) {
129
-        try {
130
-            getFileMetadataForLocalURL(inputURL);
131
-        } catch (FileNotFoundException e) {
132
-            return false;
133
-        }
134
-        return true;
135
-    }
136
-
137
-    public Uri nativeUriForFullPath(String fullPath) {
138
-        Uri ret = null;
139
-        if (fullPath != null) {
140
-            String encodedPath = Uri.fromFile(new File(fullPath)).getEncodedPath();
141
-            if (encodedPath.startsWith("/")) {
142
-                encodedPath = encodedPath.substring(1);
143
-            }
144
-            ret = rootUri.buildUpon().appendEncodedPath(encodedPath).build();
145
-        }
146
-        return ret;
147
-    }
148
-
149
-    public LocalFilesystemURL localUrlforFullPath(String fullPath) {
150
-        Uri nativeUri = nativeUriForFullPath(fullPath);
151
-        if (nativeUri != null) {
152
-            return toLocalUri(nativeUri);
153
-        }
154
-        return null;
155
-    }
156
-
157
-    /**
158
-     * Removes multiple repeated //s, and collapses processes ../s.
159
-     */
160
-    protected static String normalizePath(String rawPath) {
161
-        // If this is an absolute path, trim the leading "/" and replace it later
162
-        boolean isAbsolutePath = rawPath.startsWith("/");
163
-        if (isAbsolutePath) {
164
-            rawPath = rawPath.replaceFirst("/+", "");
165
-        }
166
-        ArrayList<String> components = new ArrayList<String>(Arrays.asList(rawPath.split("/+")));
167
-        for (int index = 0; index < components.size(); ++index) {
168
-            if (components.get(index).equals("..")) {
169
-                components.remove(index);
170
-                if (index > 0) {
171
-                    components.remove(index-1);
172
-                    --index;
173
-                }
174
-            }
175
-        }
176
-        StringBuilder normalizedPath = new StringBuilder();
177
-        for(String component: components) {
178
-            normalizedPath.append("/");
179
-            normalizedPath.append(component);
180
-        }
181
-        if (isAbsolutePath) {
182
-            return normalizedPath.toString();
183
-        } else {
184
-            return normalizedPath.toString().substring(1);
185
-        }
186
-    }
187
-
188
-    /**
189
-     * Gets the free space in bytes available on this filesystem.
190
-     * Subclasses may override this method to return nonzero free space.
191
-     */
192
-    public long getFreeSpaceInBytes() {
193
-        return 0;
194
-    }
195
-
196
-    public abstract Uri toNativeUri(LocalFilesystemURL inputURL);
197
-    public abstract LocalFilesystemURL toLocalUri(Uri inputURL);
198
-
199
-    public JSONObject getRootEntry() {
200
-        if (rootEntry == null) {
201
-            rootEntry = makeEntryForNativeUri(rootUri);
202
-        }
203
-        return rootEntry;
204
-    }
205
-
206
-	public JSONObject getParentForLocalURL(LocalFilesystemURL inputURL) throws IOException {
207
-        Uri parentUri = inputURL.uri;
208
-        String parentPath = new File(inputURL.uri.getPath()).getParent();
209
-        if (!"/".equals(parentPath)) {
210
-            parentUri = inputURL.uri.buildUpon().path(parentPath + '/').build();
211
-		}
212
-		return getEntryForLocalURL(LocalFilesystemURL.parse(parentUri));
213
-	}
214
-
215
-    protected LocalFilesystemURL makeDestinationURL(String newName, LocalFilesystemURL srcURL, LocalFilesystemURL destURL, boolean isDirectory) {
216
-        // I know this looks weird but it is to work around a JSON bug.
217
-        if ("null".equals(newName) || "".equals(newName)) {
218
-            newName = srcURL.uri.getLastPathSegment();;
219
-        }
220
-
221
-        String newDest = destURL.uri.toString();
222
-        if (newDest.endsWith("/")) {
223
-            newDest = newDest + newName;
224
-        } else {
225
-            newDest = newDest + "/" + newName;
226
-        }
227
-        if (isDirectory) {
228
-            newDest += '/';
229
-        }
230
-        return LocalFilesystemURL.parse(newDest);
231
-    }
232
-
233
-	/* Read a source URL (possibly from a different filesystem, srcFs,) and copy it to
234
-	 * the destination URL on this filesystem, optionally with a new filename.
235
-	 * If move is true, then this method should either perform an atomic move operation
236
-	 * or remove the source file when finished.
237
-	 */
238
-    public JSONObject copyFileToURL(LocalFilesystemURL destURL, String newName,
239
-            Filesystem srcFs, LocalFilesystemURL srcURL, boolean move) throws IOException, InvalidModificationException, JSONException, NoModificationAllowedException, FileExistsException {
240
-        // First, check to see that we can do it
241
-        if (move && !srcFs.canRemoveFileAtLocalURL(srcURL)) {
242
-            throw new NoModificationAllowedException("Cannot move file at source URL");
243
-        }
244
-        final LocalFilesystemURL destination = makeDestinationURL(newName, srcURL, destURL, srcURL.isDirectory);
245
-
246
-        Uri srcNativeUri = srcFs.toNativeUri(srcURL);
247
-
248
-        CordovaResourceApi.OpenForReadResult ofrr = resourceApi.openForRead(srcNativeUri);
249
-        OutputStream os = null;
250
-        try {
251
-            os = getOutputStreamForURL(destination);
252
-        } catch (IOException e) {
253
-            ofrr.inputStream.close();
254
-            throw e;
255
-        }
256
-        // Closes streams.
257
-        resourceApi.copyResource(ofrr, os);
258
-
259
-        if (move) {
260
-            srcFs.removeFileAtLocalURL(srcURL);
261
-        }
262
-        return getEntryForLocalURL(destination);
263
-    }
264
-
265
-    public OutputStream getOutputStreamForURL(LocalFilesystemURL inputURL) throws IOException {
266
-        return resourceApi.openOutputStream(toNativeUri(inputURL));
267
-    }
268
-
269
-    public void readFileAtURL(LocalFilesystemURL inputURL, long start, long end,
270
-                              ReadFileCallback readFileCallback) throws IOException {
271
-        CordovaResourceApi.OpenForReadResult ofrr = resourceApi.openForRead(toNativeUri(inputURL));
272
-        if (end < 0) {
273
-            end = ofrr.length;
274
-        }
275
-        long numBytesToRead = end - start;
276
-        try {
277
-            if (start > 0) {
278
-                ofrr.inputStream.skip(start);
279
-            }
280
-            InputStream inputStream = ofrr.inputStream;
281
-            if (end < ofrr.length) {
282
-                inputStream = new LimitedInputStream(inputStream, numBytesToRead);
283
-            }
284
-            readFileCallback.handleData(inputStream, ofrr.mimeType);
285
-        } finally {
286
-            ofrr.inputStream.close();
287
-        }
288
-    }
289
-
290
-	abstract long writeToFileAtURL(LocalFilesystemURL inputURL, String data, int offset,
291
-			boolean isBinary) throws NoModificationAllowedException, IOException;
292
-
293
-	abstract long truncateFileAtURL(LocalFilesystemURL inputURL, long size)
294
-			throws IOException, NoModificationAllowedException;
295
-
296
-	// This method should return null if filesystem urls cannot be mapped to paths
297
-	abstract String filesystemPathForURL(LocalFilesystemURL url);
298
-
299
-	abstract LocalFilesystemURL URLforFilesystemPath(String path);
300
-
301
-	abstract boolean canRemoveFileAtLocalURL(LocalFilesystemURL inputURL);
302
-
303
-    protected class LimitedInputStream extends FilterInputStream {
304
-        long numBytesToRead;
305
-        public LimitedInputStream(InputStream in, long numBytesToRead) {
306
-            super(in);
307
-            this.numBytesToRead = numBytesToRead;
308
-        }
309
-        @Override
310
-        public int read() throws IOException {
311
-            if (numBytesToRead <= 0) {
312
-                return -1;
313
-            }
314
-            numBytesToRead--;
315
-            return in.read();
316
-        }
317
-        @Override
318
-        public int read(byte[] buffer, int byteOffset, int byteCount) throws IOException {
319
-            if (numBytesToRead <= 0) {
320
-                return -1;
321
-            }
322
-            int bytesToRead = byteCount;
323
-            if (byteCount > numBytesToRead) {
324
-                bytesToRead = (int)numBytesToRead; // Cast okay; long is less than int here.
325
-            }
326
-            int numBytesRead = in.read(buffer, byteOffset, bytesToRead);
327
-            numBytesToRead -= numBytesRead;
328
-            return numBytesRead;
329
-        }
330
-    }
331
-}

+ 0
- 30
node_modules/cordova-plugin-file/src/android/InvalidModificationException.java Datei anzeigen

@@ -1,30 +0,0 @@
1
-/*
2
-       Licensed to the Apache Software Foundation (ASF) under one
3
-       or more contributor license agreements.  See the NOTICE file
4
-       distributed with this work for additional information
5
-       regarding copyright ownership.  The ASF licenses this file
6
-       to you under the Apache License, Version 2.0 (the
7
-       "License"); you may not use this file except in compliance
8
-       with the License.  You may obtain a copy of the License at
9
-
10
-         http://www.apache.org/licenses/LICENSE-2.0
11
-
12
-       Unless required by applicable law or agreed to in writing,
13
-       software distributed under the License is distributed on an
14
-       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
-       KIND, either express or implied.  See the License for the
16
-       specific language governing permissions and limitations
17
-       under the License.
18
-*/
19
-
20
-
21
-package org.apache.cordova.file;
22
-
23
-@SuppressWarnings("serial")
24
-public class InvalidModificationException extends Exception {
25
-
26
-    public InvalidModificationException(String message) {
27
-        super(message);
28
-    }
29
-
30
-}

+ 0
- 513
node_modules/cordova-plugin-file/src/android/LocalFilesystem.java Datei anzeigen

@@ -1,513 +0,0 @@
1
-/*
2
-       Licensed to the Apache Software Foundation (ASF) under one
3
-       or more contributor license agreements.  See the NOTICE file
4
-       distributed with this work for additional information
5
-       regarding copyright ownership.  The ASF licenses this file
6
-       to you under the Apache License, Version 2.0 (the
7
-       "License"); you may not use this file except in compliance
8
-       with the License.  You may obtain a copy of the License at
9
-
10
-         http://www.apache.org/licenses/LICENSE-2.0
11
-
12
-       Unless required by applicable law or agreed to in writing,
13
-       software distributed under the License is distributed on an
14
-       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
-       KIND, either express or implied.  See the License for the
16
-       specific language governing permissions and limitations
17
-       under the License.
18
- */
19
-package org.apache.cordova.file;
20
-
21
-import java.io.ByteArrayInputStream;
22
-import java.io.File;
23
-import java.io.FileInputStream;
24
-import java.io.FileNotFoundException;
25
-import java.io.FileOutputStream;
26
-import java.io.IOException;
27
-import java.io.InputStream;
28
-import java.io.OutputStream;
29
-import java.io.RandomAccessFile;
30
-import java.nio.channels.FileChannel;
31
-import org.apache.cordova.CordovaResourceApi;
32
-import org.json.JSONException;
33
-import org.json.JSONObject;
34
-
35
-import android.os.Build;
36
-import android.os.Environment;
37
-import android.util.Base64;
38
-import android.net.Uri;
39
-import android.content.Context;
40
-import android.content.Intent;
41
-
42
-import java.nio.charset.Charset;
43
-
44
-public class LocalFilesystem extends Filesystem {
45
-    private final Context context;
46
-
47
-    public LocalFilesystem(String name, Context context, CordovaResourceApi resourceApi, File fsRoot) {
48
-        super(Uri.fromFile(fsRoot).buildUpon().appendEncodedPath("").build(), name, resourceApi);
49
-        this.context = context;
50
-    }
51
-
52
-    public String filesystemPathForFullPath(String fullPath) {
53
-	    return new File(rootUri.getPath(), fullPath).toString();
54
-	}
55
-
56
-	@Override
57
-	public String filesystemPathForURL(LocalFilesystemURL url) {
58
-		return filesystemPathForFullPath(url.path);
59
-	}
60
-
61
-	private String fullPathForFilesystemPath(String absolutePath) {
62
-		if (absolutePath != null && absolutePath.startsWith(rootUri.getPath())) {
63
-			return absolutePath.substring(rootUri.getPath().length() - 1);
64
-		}
65
-		return null;
66
-	}
67
-
68
-    @Override
69
-    public Uri toNativeUri(LocalFilesystemURL inputURL) {
70
-        return nativeUriForFullPath(inputURL.path);
71
-    }
72
-
73
-    @Override
74
-    public LocalFilesystemURL toLocalUri(Uri inputURL) {
75
-        if (!"file".equals(inputURL.getScheme())) {
76
-            return null;
77
-        }
78
-        File f = new File(inputURL.getPath());
79
-        // Removes and duplicate /s (e.g. file:///a//b/c)
80
-        Uri resolvedUri = Uri.fromFile(f);
81
-        String rootUriNoTrailingSlash = rootUri.getEncodedPath();
82
-        rootUriNoTrailingSlash = rootUriNoTrailingSlash.substring(0, rootUriNoTrailingSlash.length() - 1);
83
-        if (!resolvedUri.getEncodedPath().startsWith(rootUriNoTrailingSlash)) {
84
-            return null;
85
-        }
86
-        String subPath = resolvedUri.getEncodedPath().substring(rootUriNoTrailingSlash.length());
87
-        // Strip leading slash
88
-        if (!subPath.isEmpty()) {
89
-            subPath = subPath.substring(1);
90
-        }
91
-        Uri.Builder b = new Uri.Builder()
92
-            .scheme(LocalFilesystemURL.FILESYSTEM_PROTOCOL)
93
-            .authority("localhost")
94
-            .path(name);
95
-        if (!subPath.isEmpty()) {
96
-            b.appendEncodedPath(subPath);
97
-        }
98
-        if (f.isDirectory()) {
99
-            // Add trailing / for directories.
100
-            b.appendEncodedPath("");
101
-        }
102
-        return LocalFilesystemURL.parse(b.build());
103
-    }
104
-
105
-	@Override
106
-	public LocalFilesystemURL URLforFilesystemPath(String path) {
107
-	    return localUrlforFullPath(fullPathForFilesystemPath(path));
108
-	}
109
-
110
-	@Override
111
-	public JSONObject getFileForLocalURL(LocalFilesystemURL inputURL,
112
-			String path, JSONObject options, boolean directory) throws FileExistsException, IOException, TypeMismatchException, EncodingException, JSONException {
113
-        boolean create = false;
114
-        boolean exclusive = false;
115
-
116
-        if (options != null) {
117
-            create = options.optBoolean("create");
118
-            if (create) {
119
-                exclusive = options.optBoolean("exclusive");
120
-            }
121
-        }
122
-
123
-        // Check for a ":" character in the file to line up with BB and iOS
124
-        if (path.contains(":")) {
125
-            throw new EncodingException("This path has an invalid \":\" in it.");
126
-        }
127
-
128
-        LocalFilesystemURL requestedURL;
129
-
130
-        // Check whether the supplied path is absolute or relative
131
-        if (directory && !path.endsWith("/")) {
132
-            path += "/";
133
-        }
134
-        if (path.startsWith("/")) {
135
-        	requestedURL = localUrlforFullPath(normalizePath(path));
136
-        } else {
137
-        	requestedURL = localUrlforFullPath(normalizePath(inputURL.path + "/" + path));
138
-        }
139
-
140
-        File fp = new File(this.filesystemPathForURL(requestedURL));
141
-
142
-        if (create) {
143
-            if (exclusive && fp.exists()) {
144
-                throw new FileExistsException("create/exclusive fails");
145
-            }
146
-            if (directory) {
147
-                fp.mkdir();
148
-            } else {
149
-                fp.createNewFile();
150
-            }
151
-            if (!fp.exists()) {
152
-                throw new FileExistsException("create fails");
153
-            }
154
-        }
155
-        else {
156
-            if (!fp.exists()) {
157
-                throw new FileNotFoundException("path does not exist");
158
-            }
159
-            if (directory) {
160
-                if (fp.isFile()) {
161
-                    throw new TypeMismatchException("path doesn't exist or is file");
162
-                }
163
-            } else {
164
-                if (fp.isDirectory()) {
165
-                    throw new TypeMismatchException("path doesn't exist or is directory");
166
-                }
167
-            }
168
-        }
169
-
170
-        // Return the directory
171
-        return makeEntryForURL(requestedURL);
172
-	}
173
-
174
-	@Override
175
-	public boolean removeFileAtLocalURL(LocalFilesystemURL inputURL) throws InvalidModificationException {
176
-
177
-        File fp = new File(filesystemPathForURL(inputURL));
178
-
179
-        // You can't delete a directory that is not empty
180
-        if (fp.isDirectory() && fp.list().length > 0) {
181
-            throw new InvalidModificationException("You can't delete a directory that is not empty.");
182
-        }
183
-
184
-        return fp.delete();
185
-	}
186
-
187
-    @Override
188
-    public boolean exists(LocalFilesystemURL inputURL) {
189
-        File fp = new File(filesystemPathForURL(inputURL));
190
-        return fp.exists();
191
-    }
192
-
193
-    @Override
194
-    public long getFreeSpaceInBytes() {
195
-        return DirectoryManager.getFreeSpaceInBytes(rootUri.getPath());
196
-    }
197
-
198
-    @Override
199
-	public boolean recursiveRemoveFileAtLocalURL(LocalFilesystemURL inputURL) throws FileExistsException {
200
-        File directory = new File(filesystemPathForURL(inputURL));
201
-    	return removeDirRecursively(directory);
202
-	}
203
-
204
-	protected boolean removeDirRecursively(File directory) throws FileExistsException {
205
-        if (directory.isDirectory()) {
206
-            for (File file : directory.listFiles()) {
207
-                removeDirRecursively(file);
208
-            }
209
-        }
210
-
211
-        if (!directory.delete()) {
212
-            throw new FileExistsException("could not delete: " + directory.getName());
213
-        } else {
214
-            return true;
215
-        }
216
-	}
217
-
218
-    @Override
219
-    public LocalFilesystemURL[] listChildren(LocalFilesystemURL inputURL) throws FileNotFoundException {
220
-        File fp = new File(filesystemPathForURL(inputURL));
221
-
222
-        if (!fp.exists()) {
223
-            // The directory we are listing doesn't exist so we should fail.
224
-            throw new FileNotFoundException();
225
-        }
226
-
227
-        File[] files = fp.listFiles();
228
-        if (files == null) {
229
-            // inputURL is a directory
230
-            return null;
231
-        }
232
-        LocalFilesystemURL[] entries = new LocalFilesystemURL[files.length];
233
-        for (int i = 0; i < files.length; i++) {
234
-            entries[i] = URLforFilesystemPath(files[i].getPath());
235
-        }
236
-
237
-        return entries;
238
-	}
239
-
240
-	@Override
241
-	public JSONObject getFileMetadataForLocalURL(LocalFilesystemURL inputURL) throws FileNotFoundException {
242
-        File file = new File(filesystemPathForURL(inputURL));
243
-
244
-        if (!file.exists()) {
245
-            throw new FileNotFoundException("File at " + inputURL.uri + " does not exist.");
246
-        }
247
-
248
-        JSONObject metadata = new JSONObject();
249
-        try {
250
-            // Ensure that directories report a size of 0
251
-        	metadata.put("size", file.isDirectory() ? 0 : file.length());
252
-        	metadata.put("type", resourceApi.getMimeType(Uri.fromFile(file)));
253
-        	metadata.put("name", file.getName());
254
-        	metadata.put("fullPath", inputURL.path);
255
-        	metadata.put("lastModifiedDate", file.lastModified());
256
-        } catch (JSONException e) {
257
-        	return null;
258
-        }
259
-        return metadata;
260
-	}
261
-
262
-    private void copyFile(Filesystem srcFs, LocalFilesystemURL srcURL, File destFile, boolean move) throws IOException, InvalidModificationException, NoModificationAllowedException {
263
-        if (move) {
264
-            String realSrcPath = srcFs.filesystemPathForURL(srcURL);
265
-            if (realSrcPath != null) {
266
-                File srcFile = new File(realSrcPath);
267
-                if (srcFile.renameTo(destFile)) {
268
-                    return;
269
-                }
270
-                // Trying to rename the file failed.  Possibly because we moved across file system on the device.
271
-            }
272
-        }
273
-
274
-        CordovaResourceApi.OpenForReadResult offr = resourceApi.openForRead(srcFs.toNativeUri(srcURL));
275
-        copyResource(offr, new FileOutputStream(destFile));
276
-
277
-        if (move) {
278
-            srcFs.removeFileAtLocalURL(srcURL);
279
-        }
280
-    }
281
-
282
-    private void copyDirectory(Filesystem srcFs, LocalFilesystemURL srcURL, File dstDir, boolean move) throws IOException, NoModificationAllowedException, InvalidModificationException, FileExistsException {
283
-        if (move) {
284
-            String realSrcPath = srcFs.filesystemPathForURL(srcURL);
285
-            if (realSrcPath != null) {
286
-                File srcDir = new File(realSrcPath);
287
-                // If the destination directory already exists and is empty then delete it.  This is according to spec.
288
-                if (dstDir.exists()) {
289
-                    if (dstDir.list().length > 0) {
290
-                        throw new InvalidModificationException("directory is not empty");
291
-                    }
292
-                    dstDir.delete();
293
-                }
294
-                // Try to rename the directory
295
-                if (srcDir.renameTo(dstDir)) {
296
-                    return;
297
-                }
298
-                // Trying to rename the file failed.  Possibly because we moved across file system on the device.
299
-            }
300
-        }
301
-
302
-        if (dstDir.exists()) {
303
-            if (dstDir.list().length > 0) {
304
-                throw new InvalidModificationException("directory is not empty");
305
-            }
306
-        } else {
307
-            if (!dstDir.mkdir()) {
308
-                // If we can't create the directory then fail
309
-                throw new NoModificationAllowedException("Couldn't create the destination directory");
310
-            }
311
-        }
312
-
313
-        LocalFilesystemURL[] children = srcFs.listChildren(srcURL);
314
-        for (LocalFilesystemURL childLocalUrl : children) {
315
-            File target = new File(dstDir, new File(childLocalUrl.path).getName());
316
-            if (childLocalUrl.isDirectory) {
317
-                copyDirectory(srcFs, childLocalUrl, target, false);
318
-            } else {
319
-                copyFile(srcFs, childLocalUrl, target, false);
320
-            }
321
-        }
322
-
323
-        if (move) {
324
-            srcFs.recursiveRemoveFileAtLocalURL(srcURL);
325
-        }
326
-    }
327
-
328
-	@Override
329
-	public JSONObject copyFileToURL(LocalFilesystemURL destURL, String newName,
330
-			Filesystem srcFs, LocalFilesystemURL srcURL, boolean move) throws IOException, InvalidModificationException, JSONException, NoModificationAllowedException, FileExistsException {
331
-
332
-		// Check to see if the destination directory exists
333
-        String newParent = this.filesystemPathForURL(destURL);
334
-        File destinationDir = new File(newParent);
335
-        if (!destinationDir.exists()) {
336
-            // The destination does not exist so we should fail.
337
-            throw new FileNotFoundException("The source does not exist");
338
-        }
339
-
340
-        // Figure out where we should be copying to
341
-        final LocalFilesystemURL destinationURL = makeDestinationURL(newName, srcURL, destURL, srcURL.isDirectory);
342
-
343
-        Uri dstNativeUri = toNativeUri(destinationURL);
344
-        Uri srcNativeUri = srcFs.toNativeUri(srcURL);
345
-        // Check to see if source and destination are the same file
346
-        if (dstNativeUri.equals(srcNativeUri)) {
347
-            throw new InvalidModificationException("Can't copy onto itself");
348
-        }
349
-
350
-        if (move && !srcFs.canRemoveFileAtLocalURL(srcURL)) {
351
-            throw new InvalidModificationException("Source URL is read-only (cannot move)");
352
-        }
353
-
354
-        File destFile = new File(dstNativeUri.getPath());
355
-        if (destFile.exists()) {
356
-            if (!srcURL.isDirectory && destFile.isDirectory()) {
357
-                throw new InvalidModificationException("Can't copy/move a file to an existing directory");
358
-            } else if (srcURL.isDirectory && destFile.isFile()) {
359
-                throw new InvalidModificationException("Can't copy/move a directory to an existing file");
360
-            }
361
-        }
362
-
363
-        if (srcURL.isDirectory) {
364
-            // E.g. Copy /sdcard/myDir to /sdcard/myDir/backup
365
-            if (dstNativeUri.toString().startsWith(srcNativeUri.toString() + '/')) {
366
-                throw new InvalidModificationException("Can't copy directory into itself");
367
-            }
368
-            copyDirectory(srcFs, srcURL, destFile, move);
369
-        } else {
370
-            copyFile(srcFs, srcURL, destFile, move);
371
-        }
372
-        return makeEntryForURL(destinationURL);
373
-	}
374
-
375
-	@Override
376
-	public long writeToFileAtURL(LocalFilesystemURL inputURL, String data,
377
-			int offset, boolean isBinary) throws IOException, NoModificationAllowedException {
378
-
379
-        boolean append = false;
380
-        if (offset > 0) {
381
-            this.truncateFileAtURL(inputURL, offset);
382
-            append = true;
383
-        }
384
-
385
-        byte[] rawData;
386
-        if (isBinary) {
387
-            rawData = Base64.decode(data, Base64.DEFAULT);
388
-        } else {
389
-            rawData = data.getBytes(Charset.defaultCharset());
390
-        }
391
-        ByteArrayInputStream in = new ByteArrayInputStream(rawData);
392
-        try
393
-        {
394
-        	byte buff[] = new byte[rawData.length];
395
-            String absolutePath = filesystemPathForURL(inputURL);
396
-            FileOutputStream out = new FileOutputStream(absolutePath, append);
397
-            try {
398
-            	in.read(buff, 0, buff.length);
399
-            	out.write(buff, 0, rawData.length);
400
-            	out.flush();
401
-            } finally {
402
-            	// Always close the output
403
-            	out.close();
404
-            }
405
-            if (isPublicDirectory(absolutePath)) {
406
-                broadcastNewFile(Uri.fromFile(new File(absolutePath)));
407
-            }
408
-        }
409
-        catch (NullPointerException e)
410
-        {
411
-            // This is a bug in the Android implementation of the Java Stack
412
-            NoModificationAllowedException realException = new NoModificationAllowedException(inputURL.toString());
413
-            realException.initCause(e);
414
-            throw realException;
415
-        }
416
-
417
-        return rawData.length;
418
-	}
419
-
420
-    private boolean isPublicDirectory(String absolutePath) {
421
-        // TODO: should expose a way to scan app's private files (maybe via a flag).
422
-        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
423
-            // Lollipop has a bug where SD cards are null.
424
-            for (File f : context.getExternalMediaDirs()) {
425
-                if(f != null && absolutePath.startsWith(f.getAbsolutePath())) {
426
-                    return true;
427
-                }
428
-            }
429
-        }
430
-
431
-        String extPath = Environment.getExternalStorageDirectory().getAbsolutePath();
432
-        return absolutePath.startsWith(extPath);
433
-    }
434
-
435
-     /**
436
-     * Send broadcast of new file so files appear over MTP
437
-     */
438
-    private void broadcastNewFile(Uri nativeUri) {
439
-        Intent intent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, nativeUri);
440
-        context.sendBroadcast(intent);
441
-    }
442
-
443
-	@Override
444
-	public long truncateFileAtURL(LocalFilesystemURL inputURL, long size) throws IOException {
445
-        File file = new File(filesystemPathForURL(inputURL));
446
-
447
-        if (!file.exists()) {
448
-            throw new FileNotFoundException("File at " + inputURL.uri + " does not exist.");
449
-        }
450
-
451
-        RandomAccessFile raf = new RandomAccessFile(filesystemPathForURL(inputURL), "rw");
452
-        try {
453
-            if (raf.length() >= size) {
454
-                FileChannel channel = raf.getChannel();
455
-                channel.truncate(size);
456
-                return size;
457
-            }
458
-
459
-            return raf.length();
460
-        } finally {
461
-            raf.close();
462
-        }
463
-
464
-
465
-	}
466
-
467
-	@Override
468
-	public boolean canRemoveFileAtLocalURL(LocalFilesystemURL inputURL) {
469
-		String path = filesystemPathForURL(inputURL);
470
-		File file = new File(path);
471
-		return file.exists();
472
-	}
473
-
474
-    // This is a copy & paste from CordovaResource API that is required since CordovaResourceApi
475
-    // has a bug pre-4.0.0.
476
-    // TODO: Once cordova-android@4.0.0 is released, delete this copy and make the plugin depend on
477
-    // 4.0.0 with an engine tag.
478
-    private static void copyResource(CordovaResourceApi.OpenForReadResult input, OutputStream outputStream) throws IOException {
479
-        try {
480
-            InputStream inputStream = input.inputStream;
481
-            if (inputStream instanceof FileInputStream && outputStream instanceof FileOutputStream) {
482
-                FileChannel inChannel = ((FileInputStream)input.inputStream).getChannel();
483
-                FileChannel outChannel = ((FileOutputStream)outputStream).getChannel();
484
-                long offset = 0;
485
-                long length = input.length;
486
-                if (input.assetFd != null) {
487
-                    offset = input.assetFd.getStartOffset();
488
-                }
489
-                // transferFrom()'s 2nd arg is a relative position. Need to set the absolute
490
-                // position first.
491
-                inChannel.position(offset);
492
-                outChannel.transferFrom(inChannel, 0, length);
493
-            } else {
494
-                final int BUFFER_SIZE = 8192;
495
-                byte[] buffer = new byte[BUFFER_SIZE];
496
-
497
-                for (;;) {
498
-                    int bytesRead = inputStream.read(buffer, 0, BUFFER_SIZE);
499
-
500
-                    if (bytesRead <= 0) {
501
-                        break;
502
-                    }
503
-                    outputStream.write(buffer, 0, bytesRead);
504
-                }
505
-            }
506
-        } finally {
507
-            input.inputStream.close();
508
-            if (outputStream != null) {
509
-                outputStream.close();
510
-            }
511
-        }
512
-    }
513
-}

+ 0
- 64
node_modules/cordova-plugin-file/src/android/LocalFilesystemURL.java Datei anzeigen

@@ -1,64 +0,0 @@
1
-/*
2
-       Licensed to the Apache Software Foundation (ASF) under one
3
-       or more contributor license agreements.  See the NOTICE file
4
-       distributed with this work for additional information
5
-       regarding copyright ownership.  The ASF licenses this file
6
-       to you under the Apache License, Version 2.0 (the
7
-       "License"); you may not use this file except in compliance
8
-       with the License.  You may obtain a copy of the License at
9
-
10
-         http://www.apache.org/licenses/LICENSE-2.0
11
-
12
-       Unless required by applicable law or agreed to in writing,
13
-       software distributed under the License is distributed on an
14
-       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
-       KIND, either express or implied.  See the License for the
16
-       specific language governing permissions and limitations
17
-       under the License.
18
- */
19
-package org.apache.cordova.file;
20
-
21
-import android.net.Uri;
22
-
23
-public class LocalFilesystemURL {
24
-	
25
-	public static final String FILESYSTEM_PROTOCOL = "cdvfile";
26
-
27
-    public final Uri uri;
28
-    public final String fsName;
29
-    public final String path;
30
-    public final boolean isDirectory;
31
-
32
-	private LocalFilesystemURL(Uri uri, String fsName, String fsPath, boolean isDirectory) {
33
-		this.uri = uri;
34
-        this.fsName = fsName;
35
-        this.path = fsPath;
36
-        this.isDirectory = isDirectory;
37
-	}
38
-
39
-    public static LocalFilesystemURL parse(Uri uri) {
40
-        if (!FILESYSTEM_PROTOCOL.equals(uri.getScheme())) {
41
-            return null;
42
-        }
43
-        String path = uri.getPath();
44
-        if (path.length() < 1) {
45
-            return null;
46
-        }
47
-        int firstSlashIdx = path.indexOf('/', 1);
48
-        if (firstSlashIdx < 0) {
49
-            return null;
50
-        }
51
-        String fsName = path.substring(1, firstSlashIdx);
52
-        path = path.substring(firstSlashIdx);
53
-        boolean isDirectory = path.charAt(path.length() - 1) == '/';
54
-        return new LocalFilesystemURL(uri, fsName, path, isDirectory);
55
-    }
56
-
57
-    public static LocalFilesystemURL parse(String uri) {
58
-        return parse(Uri.parse(uri));
59
-    }
60
-
61
-    public String toString() {
62
-        return uri.toString();
63
-    }
64
-}

+ 0
- 29
node_modules/cordova-plugin-file/src/android/NoModificationAllowedException.java Datei anzeigen

@@ -1,29 +0,0 @@
1
-/*
2
-       Licensed to the Apache Software Foundation (ASF) under one
3
-       or more contributor license agreements.  See the NOTICE file
4
-       distributed with this work for additional information
5
-       regarding copyright ownership.  The ASF licenses this file
6
-       to you under the Apache License, Version 2.0 (the
7
-       "License"); you may not use this file except in compliance
8
-       with the License.  You may obtain a copy of the License at
9
-
10
-         http://www.apache.org/licenses/LICENSE-2.0
11
-
12
-       Unless required by applicable law or agreed to in writing,
13
-       software distributed under the License is distributed on an
14
-       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
-       KIND, either express or implied.  See the License for the
16
-       specific language governing permissions and limitations
17
-       under the License.
18
-*/
19
-
20
-package org.apache.cordova.file;
21
-
22
-@SuppressWarnings("serial")
23
-public class NoModificationAllowedException extends Exception {
24
-
25
-    public NoModificationAllowedException(String message) {
26
-        super(message);
27
-    }
28
-
29
-}

+ 0
- 94
node_modules/cordova-plugin-file/src/android/PendingRequests.java Datei anzeigen

@@ -1,94 +0,0 @@
1
-/*
2
-       Licensed to the Apache Software Foundation (ASF) under one
3
-       or more contributor license agreements.  See the NOTICE file
4
-       distributed with this work for additional information
5
-       regarding copyright ownership.  The ASF licenses this file
6
-       to you under the Apache License, Version 2.0 (the
7
-       "License"); you may not use this file except in compliance
8
-       with the License.  You may obtain a copy of the License at
9
-
10
-         http://www.apache.org/licenses/LICENSE-2.0
11
-
12
-       Unless required by applicable law or agreed to in writing,
13
-       software distributed under the License is distributed on an
14
-       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
-       KIND, either express or implied.  See the License for the
16
-       specific language governing permissions and limitations
17
-       under the License.
18
-*/
19
-package org.apache.cordova.file;
20
-
21
-import android.util.SparseArray;
22
-
23
-import org.apache.cordova.CallbackContext;
24
-
25
-/**
26
- * Holds pending runtime permission requests
27
- */
28
-class PendingRequests {
29
-    private int currentReqId = 0;
30
-    private SparseArray<Request> requests = new SparseArray<Request>();
31
-
32
-    /**
33
-     * Creates a request and adds it to the array of pending requests. Each created request gets a
34
-     * unique result code for use with requestPermission()
35
-     * @param rawArgs           The raw arguments passed to the plugin
36
-     * @param action            The action this request corresponds to (get file, etc.)
37
-     * @param callbackContext   The CallbackContext for this plugin call
38
-     * @return                  The request code that can be used to retrieve the Request object
39
-     */
40
-    public synchronized int createRequest(String rawArgs, int action, CallbackContext callbackContext)  {
41
-        Request req = new Request(rawArgs, action, callbackContext);
42
-        requests.put(req.requestCode, req);
43
-        return req.requestCode;
44
-    }
45
-
46
-    /**
47
-     * Gets the request corresponding to this request code and removes it from the pending requests
48
-     * @param requestCode   The request code for the desired request
49
-     * @return              The request corresponding to the given request code or null if such a
50
-     *                      request is not found
51
-     */
52
-    public synchronized Request getAndRemove(int requestCode) {
53
-        Request result = requests.get(requestCode);
54
-        requests.remove(requestCode);
55
-        return result;
56
-    }
57
-
58
-    /**
59
-     * Holds the options and CallbackContext for a call made to the plugin.
60
-     */
61
-    public class Request {
62
-
63
-        // Unique int used to identify this request in any Android permission callback
64
-        private int requestCode;
65
-
66
-        // Action to be performed after permission request result
67
-        private int action;
68
-
69
-        // Raw arguments passed to plugin
70
-        private String rawArgs;
71
-
72
-        // The callback context for this plugin request
73
-        private CallbackContext callbackContext;
74
-
75
-        private Request(String rawArgs, int action, CallbackContext callbackContext) {
76
-            this.rawArgs = rawArgs;
77
-            this.action = action;
78
-            this.callbackContext = callbackContext;
79
-            this.requestCode = currentReqId ++;
80
-        }
81
-
82
-        public int getAction() {
83
-            return this.action;
84
-        }
85
-
86
-        public String getRawArgs() {
87
-            return rawArgs;
88
-        }
89
-
90
-        public CallbackContext getCallbackContext() {
91
-            return callbackContext;
92
-        }
93
-    }
94
-}

+ 0
- 30
node_modules/cordova-plugin-file/src/android/TypeMismatchException.java Datei anzeigen

@@ -1,30 +0,0 @@
1
-/*
2
-       Licensed to the Apache Software Foundation (ASF) under one
3
-       or more contributor license agreements.  See the NOTICE file
4
-       distributed with this work for additional information
5
-       regarding copyright ownership.  The ASF licenses this file
6
-       to you under the Apache License, Version 2.0 (the
7
-       "License"); you may not use this file except in compliance
8
-       with the License.  You may obtain a copy of the License at
9
-
10
-         http://www.apache.org/licenses/LICENSE-2.0
11
-
12
-       Unless required by applicable law or agreed to in writing,
13
-       software distributed under the License is distributed on an
14
-       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
-       KIND, either express or implied.  See the License for the
16
-       specific language governing permissions and limitations
17
-       under the License.
18
-*/
19
-
20
-
21
-package org.apache.cordova.file;
22
-
23
-@SuppressWarnings("serial")
24
-public class TypeMismatchException extends Exception {
25
-
26
-    public TypeMismatchException(String message) {
27
-        super(message);
28
-    }
29
-
30
-}

+ 0
- 47
node_modules/cordova-plugin-file/src/android/build-extras.gradle Datei anzeigen

@@ -1,47 +0,0 @@
1
-/*
2
-       Licensed to the Apache Software Foundation (ASF) under one
3
-       or more contributor license agreements.  See the NOTICE file
4
-       distributed with this work for additional information
5
-       regarding copyright ownership.  The ASF licenses this file
6
-       to you under the Apache License, Version 2.0 (the
7
-       "License"); you may not use this file except in compliance
8
-       with the License.  You may obtain a copy of the License at
9
-
10
-         http://www.apache.org/licenses/LICENSE-2.0
11
-
12
-       Unless required by applicable law or agreed to in writing,
13
-       software distributed under the License is distributed on an
14
-       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
-       KIND, either express or implied.  See the License for the
16
-       specific language governing permissions and limitations
17
-       under the License.
18
- */
19
-ext.postBuildExtras = {
20
-    def inAssetsDir = file("assets")
21
-    def outAssetsDir = inAssetsDir
22
-    def outFile = new File(outAssetsDir, "cdvasset.manifest")
23
-
24
-    def newTask = task("cdvCreateAssetManifest") << {
25
-        def contents = new HashMap()
26
-        def sizes = new HashMap()
27
-        contents[""] = inAssetsDir.list()
28
-        def tree = fileTree(dir: inAssetsDir)
29
-        tree.visit { fileDetails ->
30
-            if (fileDetails.isDirectory()) {
31
-                contents[fileDetails.relativePath.toString()] = fileDetails.file.list()
32
-            } else {
33
-                sizes[fileDetails.relativePath.toString()] = fileDetails.file.length()
34
-            }
35
-        }
36
-
37
-        outAssetsDir.mkdirs()
38
-        outFile.withObjectOutputStream { oos ->
39
-            oos.writeObject(contents)
40
-            oos.writeObject(sizes)
41
-        }
42
-    }
43
-    newTask.inputs.dir inAssetsDir
44
-    newTask.outputs.file outFile
45
-    def preBuildTask = tasks["preBuild"]
46
-    preBuildTask.dependsOn(newTask)
47
-}

+ 0
- 1059
node_modules/cordova-plugin-file/src/browser/FileProxy.js
Datei-Diff unterdrückt, da er zu groß ist
Datei anzeigen


+ 0
- 30
node_modules/cordova-plugin-file/src/ios/CDVAssetLibraryFilesystem.h Datei anzeigen

@@ -1,30 +0,0 @@
1
-/*
2
- Licensed to the Apache Software Foundation (ASF) under one
3
- or more contributor license agreements.  See the NOTICE file
4
- distributed with this work for additional information
5
- regarding copyright ownership.  The ASF licenses this file
6
- to you under the Apache License, Version 2.0 (the
7
- "License"); you may not use this file except in compliance
8
- with the License.  You may obtain a copy of the License at
9
-
10
- http://www.apache.org/licenses/LICENSE-2.0
11
-
12
- Unless required by applicable law or agreed to in writing,
13
- software distributed under the License is distributed on an
14
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
- KIND, either express or implied.  See the License for the
16
- specific language governing permissions and limitations
17
- under the License.
18
- */
19
-
20
-#import "CDVFile.h"
21
-
22
-extern NSString* const kCDVAssetsLibraryPrefix;
23
-extern NSString* const kCDVAssetsLibraryScheme;
24
-
25
-@interface CDVAssetLibraryFilesystem : NSObject<CDVFileSystem> {
26
-}
27
-
28
-- (id) initWithName:(NSString *)name;
29
-
30
-@end

+ 0
- 253
node_modules/cordova-plugin-file/src/ios/CDVAssetLibraryFilesystem.m Datei anzeigen

@@ -1,253 +0,0 @@
1
-/*
2
- Licensed to the Apache Software Foundation (ASF) under one
3
- or more contributor license agreements.  See the NOTICE file
4
- distributed with this work for additional information
5
- regarding copyright ownership.  The ASF licenses this file
6
- to you under the Apache License, Version 2.0 (the
7
- "License"); you may not use this file except in compliance
8
- with the License.  You may obtain a copy of the License at
9
-
10
- http://www.apache.org/licenses/LICENSE-2.0
11
-
12
- Unless required by applicable law or agreed to in writing,
13
- software distributed under the License is distributed on an
14
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
- KIND, either express or implied.  See the License for the
16
- specific language governing permissions and limitations
17
- under the License.
18
- */
19
-
20
-#import "CDVFile.h"
21
-#import "CDVAssetLibraryFilesystem.h"
22
-#import <Cordova/CDV.h>
23
-#import <AssetsLibrary/ALAsset.h>
24
-#import <AssetsLibrary/ALAssetRepresentation.h>
25
-#import <AssetsLibrary/ALAssetsLibrary.h>
26
-#import <MobileCoreServices/MobileCoreServices.h>
27
-
28
-NSString* const kCDVAssetsLibraryPrefix = @"assets-library://";
29
-NSString* const kCDVAssetsLibraryScheme = @"assets-library";
30
-
31
-@implementation CDVAssetLibraryFilesystem
32
-@synthesize name=_name, urlTransformer;
33
-
34
-
35
-/*
36
- The CDVAssetLibraryFilesystem works with resources which are identified
37
- by iOS as
38
-   asset-library://<path>
39
- and represents them internally as URLs of the form
40
-   cdvfile://localhost/assets-library/<path>
41
- */
42
-
43
-- (NSURL *)assetLibraryURLForLocalURL:(CDVFilesystemURL *)url
44
-{
45
-    if ([url.url.scheme isEqualToString:kCDVFilesystemURLPrefix]) {
46
-        NSString *path = [[url.url absoluteString] substringFromIndex:[@"cdvfile://localhost/assets-library" length]];
47
-        return [NSURL URLWithString:[NSString stringWithFormat:@"assets-library:/%@", path]];
48
-    }
49
-    return url.url;
50
-}
51
-
52
-- (CDVPluginResult *)entryForLocalURI:(CDVFilesystemURL *)url
53
-{
54
-    NSDictionary* entry = [self makeEntryForLocalURL:url];
55
-    return [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:entry];
56
-}
57
-
58
-- (NSDictionary *)makeEntryForLocalURL:(CDVFilesystemURL *)url {
59
-    return [self makeEntryForPath:url.fullPath isDirectory:NO];
60
-}
61
-
62
-- (NSDictionary*)makeEntryForPath:(NSString*)fullPath isDirectory:(BOOL)isDir
63
-{
64
-    NSMutableDictionary* dirEntry = [NSMutableDictionary dictionaryWithCapacity:5];
65
-    NSString* lastPart = [fullPath lastPathComponent];
66
-    if (isDir && ![fullPath hasSuffix:@"/"]) {
67
-        fullPath = [fullPath stringByAppendingString:@"/"];
68
-    }
69
-    [dirEntry setObject:[NSNumber numberWithBool:!isDir]  forKey:@"isFile"];
70
-    [dirEntry setObject:[NSNumber numberWithBool:isDir]  forKey:@"isDirectory"];
71
-    [dirEntry setObject:fullPath forKey:@"fullPath"];
72
-    [dirEntry setObject:lastPart forKey:@"name"];
73
-    [dirEntry setObject:self.name forKey: @"filesystemName"];
74
-
75
-    NSURL* nativeURL = [NSURL URLWithString:[NSString stringWithFormat:@"assets-library:/%@",fullPath]];
76
-    if (self.urlTransformer) {
77
-        nativeURL = self.urlTransformer(nativeURL);
78
-    }
79
-    dirEntry[@"nativeURL"] = [nativeURL absoluteString];
80
-
81
-    return dirEntry;
82
-}
83
-
84
-/* helper function to get the mimeType from the file extension
85
- * IN:
86
- *	NSString* fullPath - filename (may include path)
87
- * OUT:
88
- *	NSString* the mime type as type/subtype.  nil if not able to determine
89
- */
90
-+ (NSString*)getMimeTypeFromPath:(NSString*)fullPath
91
-{
92
-    NSString* mimeType = nil;
93
-
94
-    if (fullPath) {
95
-        CFStringRef typeId = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (__bridge CFStringRef)[fullPath pathExtension], NULL);
96
-        if (typeId) {
97
-            mimeType = (__bridge_transfer NSString*)UTTypeCopyPreferredTagWithClass(typeId, kUTTagClassMIMEType);
98
-            if (!mimeType) {
99
-                // special case for m4a
100
-                if ([(__bridge NSString*)typeId rangeOfString : @"m4a-audio"].location != NSNotFound) {
101
-                    mimeType = @"audio/mp4";
102
-                } else if ([[fullPath pathExtension] rangeOfString:@"wav"].location != NSNotFound) {
103
-                    mimeType = @"audio/wav";
104
-                } else if ([[fullPath pathExtension] rangeOfString:@"css"].location != NSNotFound) {
105
-                    mimeType = @"text/css";
106
-                }
107
-            }
108
-            CFRelease(typeId);
109
-        }
110
-    }
111
-    return mimeType;
112
-}
113
-
114
-- (id)initWithName:(NSString *)name
115
-{
116
-    if (self) {
117
-        self.name = name;
118
-    }
119
-    return self;
120
-}
121
-
122
-- (CDVPluginResult *)getFileForURL:(CDVFilesystemURL *)baseURI requestedPath:(NSString *)requestedPath options:(NSDictionary *)options
123
-{
124
-    // return unsupported result for assets-library URLs
125
-   return [CDVPluginResult resultWithStatus:CDVCommandStatus_MALFORMED_URL_EXCEPTION messageAsString:@"getFile not supported for assets-library URLs."];
126
-}
127
-
128
-- (CDVPluginResult*)getParentForURL:(CDVFilesystemURL *)localURI
129
-{
130
-    // we don't (yet?) support getting the parent of an asset
131
-    return [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:NOT_READABLE_ERR];
132
-}
133
-
134
-- (CDVPluginResult*)setMetadataForURL:(CDVFilesystemURL *)localURI withObject:(NSDictionary *)options
135
-{
136
-    // setMetadata doesn't make sense for asset library files
137
-    return [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR];
138
-}
139
-
140
-- (CDVPluginResult *)removeFileAtURL:(CDVFilesystemURL *)localURI
141
-{
142
-    // return error for assets-library URLs
143
-    return [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:INVALID_MODIFICATION_ERR];
144
-}
145
-
146
-- (CDVPluginResult *)recursiveRemoveFileAtURL:(CDVFilesystemURL *)localURI
147
-{
148
-    // return error for assets-library URLs
149
-    return [CDVPluginResult resultWithStatus:CDVCommandStatus_MALFORMED_URL_EXCEPTION messageAsString:@"removeRecursively not supported for assets-library URLs."];
150
-}
151
-
152
-- (CDVPluginResult *)readEntriesAtURL:(CDVFilesystemURL *)localURI
153
-{
154
-    // return unsupported result for assets-library URLs
155
-    return [CDVPluginResult resultWithStatus:CDVCommandStatus_MALFORMED_URL_EXCEPTION messageAsString:@"readEntries not supported for assets-library URLs."];
156
-}
157
-
158
-- (CDVPluginResult *)truncateFileAtURL:(CDVFilesystemURL *)localURI atPosition:(unsigned long long)pos
159
-{
160
-    // assets-library files can't be truncated
161
-    return [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:NO_MODIFICATION_ALLOWED_ERR];
162
-}
163
-
164
-- (CDVPluginResult *)writeToFileAtURL:(CDVFilesystemURL *)localURL withData:(NSData*)encData append:(BOOL)shouldAppend
165
-{
166
-    // text can't be written into assets-library files
167
-    return [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:NO_MODIFICATION_ALLOWED_ERR];
168
-}
169
-
170
-- (void)copyFileToURL:(CDVFilesystemURL *)destURL withName:(NSString *)newName fromFileSystem:(NSObject<CDVFileSystem> *)srcFs atURL:(CDVFilesystemURL *)srcURL copy:(BOOL)bCopy callback:(void (^)(CDVPluginResult *))callback
171
-{
172
-    // Copying to an assets library file is not doable, since we can't write it.
173
-    CDVPluginResult *result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:INVALID_MODIFICATION_ERR];
174
-    callback(result);
175
-}
176
-
177
-- (NSString *)filesystemPathForURL:(CDVFilesystemURL *)url
178
-{
179
-    NSString *path = nil;
180
-    if ([[url.url scheme] isEqualToString:kCDVAssetsLibraryScheme]) {
181
-        path = [url.url path];
182
-    } else {
183
-       path = url.fullPath;
184
-    }
185
-    if ([path hasSuffix:@"/"]) {
186
-      path = [path substringToIndex:([path length]-1)];
187
-    }
188
-    return path;
189
-}
190
-
191
-- (void)readFileAtURL:(CDVFilesystemURL *)localURL start:(NSInteger)start end:(NSInteger)end callback:(void (^)(NSData*, NSString* mimeType, CDVFileError))callback
192
-{
193
-    ALAssetsLibraryAssetForURLResultBlock resultBlock = ^(ALAsset* asset) {
194
-        if (asset) {
195
-            // We have the asset!  Get the data and send it off.
196
-            ALAssetRepresentation* assetRepresentation = [asset defaultRepresentation];
197
-            NSUInteger size = (end > start) ? (end - start) : [assetRepresentation size];
198
-            Byte* buffer = (Byte*)malloc(size);
199
-            NSUInteger bufferSize = [assetRepresentation getBytes:buffer fromOffset:start length:size error:nil];
200
-            NSData* data = [NSData dataWithBytesNoCopy:buffer length:bufferSize freeWhenDone:YES];
201
-            NSString* MIMEType = (__bridge_transfer NSString*)UTTypeCopyPreferredTagWithClass((__bridge CFStringRef)[assetRepresentation UTI], kUTTagClassMIMEType);
202
-
203
-            callback(data, MIMEType, NO_ERROR);
204
-        } else {
205
-            callback(nil, nil, NOT_FOUND_ERR);
206
-        }
207
-    };
208
-
209
-    ALAssetsLibraryAccessFailureBlock failureBlock = ^(NSError* error) {
210
-        // Retrieving the asset failed for some reason.  Send the appropriate error.
211
-        NSLog(@"Error: %@", error);
212
-        callback(nil, nil, SECURITY_ERR);
213
-    };
214
-
215
-    ALAssetsLibrary* assetsLibrary = [[ALAssetsLibrary alloc] init];
216
-    [assetsLibrary assetForURL:[self assetLibraryURLForLocalURL:localURL] resultBlock:resultBlock failureBlock:failureBlock];
217
-}
218
-
219
-- (void)getFileMetadataForURL:(CDVFilesystemURL *)localURL callback:(void (^)(CDVPluginResult *))callback
220
-{
221
-    // In this case, we need to use an asynchronous method to retrieve the file.
222
-    // Because of this, we can't just assign to `result` and send it at the end of the method.
223
-    // Instead, we return after calling the asynchronous method and send `result` in each of the blocks.
224
-    ALAssetsLibraryAssetForURLResultBlock resultBlock = ^(ALAsset* asset) {
225
-        if (asset) {
226
-            // We have the asset!  Populate the dictionary and send it off.
227
-            NSMutableDictionary* fileInfo = [NSMutableDictionary dictionaryWithCapacity:5];
228
-            ALAssetRepresentation* assetRepresentation = [asset defaultRepresentation];
229
-            [fileInfo setObject:[NSNumber numberWithUnsignedLongLong:[assetRepresentation size]] forKey:@"size"];
230
-            [fileInfo setObject:localURL.fullPath forKey:@"fullPath"];
231
-            NSString* filename = [assetRepresentation filename];
232
-            [fileInfo setObject:filename forKey:@"name"];
233
-            [fileInfo setObject:[CDVAssetLibraryFilesystem getMimeTypeFromPath:filename] forKey:@"type"];
234
-            NSDate* creationDate = [asset valueForProperty:ALAssetPropertyDate];
235
-            NSNumber* msDate = [NSNumber numberWithDouble:[creationDate timeIntervalSince1970] * 1000];
236
-            [fileInfo setObject:msDate forKey:@"lastModifiedDate"];
237
-
238
-            callback([CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:fileInfo]);
239
-        } else {
240
-            // We couldn't find the asset.  Send the appropriate error.
241
-            callback([CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:NOT_FOUND_ERR]);
242
-        }
243
-    };
244
-    ALAssetsLibraryAccessFailureBlock failureBlock = ^(NSError* error) {
245
-        // Retrieving the asset failed for some reason.  Send the appropriate error.
246
-        callback([CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsString:[error localizedDescription]]);
247
-    };
248
-
249
-    ALAssetsLibrary* assetsLibrary = [[ALAssetsLibrary alloc] init];
250
-    [assetsLibrary assetForURL:[self assetLibraryURLForLocalURL:localURL] resultBlock:resultBlock failureBlock:failureBlock];
251
-    return;
252
-}
253
-@end

+ 0
- 157
node_modules/cordova-plugin-file/src/ios/CDVFile.h Datei anzeigen

@@ -1,157 +0,0 @@
1
-/*
2
- Licensed to the Apache Software Foundation (ASF) under one
3
- or more contributor license agreements.  See the NOTICE file
4
- distributed with this work for additional information
5
- regarding copyright ownership.  The ASF licenses this file
6
- to you under the Apache License, Version 2.0 (the
7
- "License"); you may not use this file except in compliance
8
- with the License.  You may obtain a copy of the License at
9
-
10
- http://www.apache.org/licenses/LICENSE-2.0
11
-
12
- Unless required by applicable law or agreed to in writing,
13
- software distributed under the License is distributed on an
14
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
- KIND, either express or implied.  See the License for the
16
- specific language governing permissions and limitations
17
- under the License.
18
- */
19
-
20
-#import <Foundation/Foundation.h>
21
-#import <Cordova/CDVPlugin.h>
22
-
23
-extern NSString* const kCDVAssetsLibraryPrefix;
24
-extern NSString* const kCDVFilesystemURLPrefix;
25
-
26
-enum CDVFileError {
27
-    NO_ERROR = 0,
28
-    NOT_FOUND_ERR = 1,
29
-    SECURITY_ERR = 2,
30
-    ABORT_ERR = 3,
31
-    NOT_READABLE_ERR = 4,
32
-    ENCODING_ERR = 5,
33
-    NO_MODIFICATION_ALLOWED_ERR = 6,
34
-    INVALID_STATE_ERR = 7,
35
-    SYNTAX_ERR = 8,
36
-    INVALID_MODIFICATION_ERR = 9,
37
-    QUOTA_EXCEEDED_ERR = 10,
38
-    TYPE_MISMATCH_ERR = 11,
39
-    PATH_EXISTS_ERR = 12
40
-};
41
-typedef int CDVFileError;
42
-
43
-@interface CDVFilesystemURL : NSObject  {
44
-    NSURL *_url;
45
-    NSString *_fileSystemName;
46
-    NSString *_fullPath;
47
-}
48
-
49
-- (id) initWithString:(NSString*)strURL;
50
-- (id) initWithURL:(NSURL*)URL;
51
-+ (CDVFilesystemURL *)fileSystemURLWithString:(NSString *)strURL;
52
-+ (CDVFilesystemURL *)fileSystemURLWithURL:(NSURL *)URL;
53
-
54
-- (NSString *)absoluteURL;
55
-
56
-@property (atomic) NSURL *url;
57
-@property (atomic) NSString *fileSystemName;
58
-@property (atomic) NSString *fullPath;
59
-
60
-@end
61
-
62
-@interface CDVFilesystemURLProtocol : NSURLProtocol
63
-@end
64
-
65
-@protocol CDVFileSystem
66
-- (CDVPluginResult *)entryForLocalURI:(CDVFilesystemURL *)url;
67
-- (CDVPluginResult *)getFileForURL:(CDVFilesystemURL *)baseURI requestedPath:(NSString *)requestedPath options:(NSDictionary *)options;
68
-- (CDVPluginResult *)getParentForURL:(CDVFilesystemURL *)localURI;
69
-- (CDVPluginResult *)setMetadataForURL:(CDVFilesystemURL *)localURI withObject:(NSDictionary *)options;
70
-- (CDVPluginResult *)removeFileAtURL:(CDVFilesystemURL *)localURI;
71
-- (CDVPluginResult *)recursiveRemoveFileAtURL:(CDVFilesystemURL *)localURI;
72
-- (CDVPluginResult *)readEntriesAtURL:(CDVFilesystemURL *)localURI;
73
-- (CDVPluginResult *)truncateFileAtURL:(CDVFilesystemURL *)localURI atPosition:(unsigned long long)pos;
74
-- (CDVPluginResult *)writeToFileAtURL:(CDVFilesystemURL *)localURL withData:(NSData*)encData append:(BOOL)shouldAppend;
75
-- (void)copyFileToURL:(CDVFilesystemURL *)destURL withName:(NSString *)newName fromFileSystem:(NSObject<CDVFileSystem> *)srcFs atURL:(CDVFilesystemURL *)srcURL copy:(BOOL)bCopy callback:(void (^)(CDVPluginResult *))callback;
76
-- (void)readFileAtURL:(CDVFilesystemURL *)localURL start:(NSInteger)start end:(NSInteger)end callback:(void (^)(NSData*, NSString* mimeType, CDVFileError))callback;
77
-- (void)getFileMetadataForURL:(CDVFilesystemURL *)localURL callback:(void (^)(CDVPluginResult *))callback;
78
-
79
-- (NSDictionary *)makeEntryForLocalURL:(CDVFilesystemURL *)url;
80
-- (NSDictionary*)makeEntryForPath:(NSString*)fullPath isDirectory:(BOOL)isDir;
81
-
82
-@property (nonatomic,strong) NSString *name;
83
-@property (nonatomic, copy) NSURL*(^urlTransformer)(NSURL*);
84
-
85
-@optional
86
-- (NSString *)filesystemPathForURL:(CDVFilesystemURL *)localURI;
87
-- (CDVFilesystemURL *)URLforFilesystemPath:(NSString *)path;
88
-
89
-@end
90
-
91
-@interface CDVFile : CDVPlugin {
92
-    NSString* rootDocsPath;
93
-    NSString* appDocsPath;
94
-    NSString* appLibraryPath;
95
-    NSString* appTempPath;
96
-
97
-    NSMutableArray* fileSystems_;
98
-    BOOL userHasAllowed;
99
-}
100
-
101
-- (NSNumber*)checkFreeDiskSpace:(NSString*)appPath;
102
-- (NSDictionary*)makeEntryForPath:(NSString*)fullPath fileSystemName:(NSString *)fsName isDirectory:(BOOL)isDir;
103
-- (NSDictionary *)makeEntryForURL:(NSURL *)URL;
104
-- (CDVFilesystemURL *)fileSystemURLforLocalPath:(NSString *)localPath;
105
-
106
-- (NSObject<CDVFileSystem> *)filesystemForURL:(CDVFilesystemURL *)localURL;
107
-
108
-/* Native Registration API */
109
-- (void)registerFilesystem:(NSObject<CDVFileSystem> *)fs;
110
-- (NSObject<CDVFileSystem> *)fileSystemByName:(NSString *)fsName;
111
-
112
-/* Exec API */
113
-- (void)requestFileSystem:(CDVInvokedUrlCommand*)command;
114
-- (void)resolveLocalFileSystemURI:(CDVInvokedUrlCommand*)command;
115
-- (void)getDirectory:(CDVInvokedUrlCommand*)command;
116
-- (void)getFile:(CDVInvokedUrlCommand*)command;
117
-- (void)getParent:(CDVInvokedUrlCommand*)command;
118
-- (void)removeRecursively:(CDVInvokedUrlCommand*)command;
119
-- (void)remove:(CDVInvokedUrlCommand*)command;
120
-- (void)copyTo:(CDVInvokedUrlCommand*)command;
121
-- (void)moveTo:(CDVInvokedUrlCommand*)command;
122
-- (void)getFileMetadata:(CDVInvokedUrlCommand*)command;
123
-- (void)readEntries:(CDVInvokedUrlCommand*)command;
124
-- (void)readAsText:(CDVInvokedUrlCommand*)command;
125
-- (void)readAsDataURL:(CDVInvokedUrlCommand*)command;
126
-- (void)readAsArrayBuffer:(CDVInvokedUrlCommand*)command;
127
-- (void)write:(CDVInvokedUrlCommand*)command;
128
-- (void)testFileExists:(CDVInvokedUrlCommand*)command;
129
-- (void)testDirectoryExists:(CDVInvokedUrlCommand*)command;
130
-- (void)getFreeDiskSpace:(CDVInvokedUrlCommand*)command;
131
-- (void)truncate:(CDVInvokedUrlCommand*)command;
132
-- (void)doCopyMove:(CDVInvokedUrlCommand*)command isCopy:(BOOL)bCopy;
133
-
134
-/* Compatibilty with older File API */
135
-- (NSString*)getMimeTypeFromPath:(NSString*)fullPath;
136
-- (NSDictionary *)getDirectoryEntry:(NSString *)target isDirectory:(BOOL)bDirRequest;
137
-
138
-/* Conversion between filesystem paths and URLs */
139
-- (NSString *)filesystemPathForURL:(CDVFilesystemURL *)URL;
140
-
141
-/* Internal methods for testing */
142
-- (void)_getLocalFilesystemPath:(CDVInvokedUrlCommand*)command;
143
-
144
-@property (nonatomic, strong) NSString* rootDocsPath;
145
-@property (nonatomic, strong) NSString* appDocsPath;
146
-@property (nonatomic, strong) NSString* appLibraryPath;
147
-@property (nonatomic, strong) NSString* appTempPath;
148
-@property (nonatomic, strong) NSString* persistentPath;
149
-@property (nonatomic, strong) NSString* temporaryPath;
150
-@property (nonatomic, strong) NSMutableArray* fileSystems;
151
-
152
-@property BOOL userHasAllowed;
153
-
154
-@end
155
-
156
-#define kW3FileTemporary @"temporary"
157
-#define kW3FilePersistent @"persistent"

+ 0
- 1119
node_modules/cordova-plugin-file/src/ios/CDVFile.m
Datei-Diff unterdrückt, da er zu groß ist
Datei anzeigen


+ 0
- 32
node_modules/cordova-plugin-file/src/ios/CDVLocalFilesystem.h Datei anzeigen

@@ -1,32 +0,0 @@
1
-/*
2
- Licensed to the Apache Software Foundation (ASF) under one
3
- or more contributor license agreements.  See the NOTICE file
4
- distributed with this work for additional information
5
- regarding copyright ownership.  The ASF licenses this file
6
- to you under the Apache License, Version 2.0 (the
7
- "License"); you may not use this file except in compliance
8
- with the License.  You may obtain a copy of the License at
9
-
10
- http://www.apache.org/licenses/LICENSE-2.0
11
-
12
- Unless required by applicable law or agreed to in writing,
13
- software distributed under the License is distributed on an
14
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
- KIND, either express or implied.  See the License for the
16
- specific language governing permissions and limitations
17
- under the License.
18
- */
19
-
20
-#import "CDVFile.h"
21
-
22
-@interface CDVLocalFilesystem : NSObject<CDVFileSystem> {
23
-    NSString *_name;
24
-    NSString *_fsRoot;
25
-}
26
-
27
-- (id) initWithName:(NSString *)name root:(NSString *)fsRoot;
28
-+ (NSString*)getMimeTypeFromPath:(NSString*)fullPath;
29
-
30
-@property (nonatomic,strong) NSString *fsRoot;
31
-
32
-@end

+ 0
- 750
node_modules/cordova-plugin-file/src/ios/CDVLocalFilesystem.m Datei anzeigen

@@ -1,750 +0,0 @@
1
-/*
2
- Licensed to the Apache Software Foundation (ASF) under one
3
- or more contributor license agreements.  See the NOTICE file
4
- distributed with this work for additional information
5
- regarding copyright ownership.  The ASF licenses this file
6
- to you under the Apache License, Version 2.0 (the
7
- "License"); you may not use this file except in compliance
8
- with the License.  You may obtain a copy of the License at
9
-
10
- http://www.apache.org/licenses/LICENSE-2.0
11
-
12
- Unless required by applicable law or agreed to in writing,
13
- software distributed under the License is distributed on an
14
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
- KIND, either express or implied.  See the License for the
16
- specific language governing permissions and limitations
17
- under the License.
18
- */
19
-
20
-#import "CDVFile.h"
21
-#import "CDVLocalFilesystem.h"
22
-#import <Cordova/CDV.h>
23
-#import <MobileCoreServices/MobileCoreServices.h>
24
-#import <sys/xattr.h>
25
-
26
-@implementation CDVLocalFilesystem
27
-@synthesize name=_name, fsRoot=_fsRoot, urlTransformer;
28
-
29
-- (id) initWithName:(NSString *)name root:(NSString *)fsRoot
30
-{
31
-    if (self) {
32
-        self.name = name;
33
-        self.fsRoot = fsRoot;
34
-    }
35
-    return self;
36
-}
37
-
38
-/*
39
- * IN
40
- *  NSString localURI
41
- * OUT
42
- *  CDVPluginResult result containing a file or directoryEntry for the localURI, or an error if the
43
- *   URI represents a non-existent path, or is unrecognized or otherwise malformed.
44
- */
45
-- (CDVPluginResult *)entryForLocalURI:(CDVFilesystemURL *)url
46
-{
47
-    CDVPluginResult* result = nil;
48
-    NSDictionary* entry = [self makeEntryForLocalURL:url];
49
-    if (entry) {
50
-        result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:entry];
51
-    } else {
52
-        // return NOT_FOUND_ERR
53
-        result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:NOT_FOUND_ERR];
54
-    }
55
-    return result;
56
-}
57
-- (NSDictionary *)makeEntryForLocalURL:(CDVFilesystemURL *)url {
58
-    NSString *path = [self filesystemPathForURL:url];
59
-    NSFileManager* fileMgr = [[NSFileManager alloc] init];
60
-    BOOL isDir = NO;
61
-    // see if exists and is file or dir
62
-    BOOL bExists = [fileMgr fileExistsAtPath:path isDirectory:&isDir];
63
-    if (bExists) {
64
-        return [self makeEntryForPath:url.fullPath isDirectory:isDir];
65
-    } else {
66
-        return nil;
67
-    }
68
-}
69
-- (NSDictionary*)makeEntryForPath:(NSString*)fullPath isDirectory:(BOOL)isDir
70
-{
71
-    NSMutableDictionary* dirEntry = [NSMutableDictionary dictionaryWithCapacity:5];
72
-    NSString* lastPart = [[self stripQueryParametersFromPath:fullPath] lastPathComponent];
73
-    if (isDir && ![fullPath hasSuffix:@"/"]) {
74
-        fullPath = [fullPath stringByAppendingString:@"/"];
75
-    }
76
-    [dirEntry setObject:[NSNumber numberWithBool:!isDir]  forKey:@"isFile"];
77
-    [dirEntry setObject:[NSNumber numberWithBool:isDir]  forKey:@"isDirectory"];
78
-    [dirEntry setObject:fullPath forKey:@"fullPath"];
79
-    [dirEntry setObject:lastPart forKey:@"name"];
80
-    [dirEntry setObject:self.name forKey: @"filesystemName"];
81
-
82
-    NSURL* nativeURL = [NSURL fileURLWithPath:[self filesystemPathForFullPath:fullPath]];
83
-    if (self.urlTransformer) {
84
-        nativeURL = self.urlTransformer(nativeURL);
85
-    }
86
-
87
-    dirEntry[@"nativeURL"] = [nativeURL absoluteString];
88
-
89
-    return dirEntry;
90
-}
91
-
92
-- (NSString *)stripQueryParametersFromPath:(NSString *)fullPath
93
-{
94
-    NSRange questionMark = [fullPath rangeOfString:@"?"];
95
-    if (questionMark.location != NSNotFound) {
96
-        return [fullPath substringWithRange:NSMakeRange(0,questionMark.location)];
97
-    }
98
-    return fullPath;
99
-}
100
-
101
-- (NSString *)filesystemPathForFullPath:(NSString *)fullPath
102
-{
103
-    NSString *path = nil;
104
-    NSString *strippedFullPath = [self stripQueryParametersFromPath:fullPath];
105
-    path = [NSString stringWithFormat:@"%@%@", self.fsRoot, strippedFullPath];
106
-    if ([path length] > 1 && [path hasSuffix:@"/"]) {
107
-      path = [path substringToIndex:([path length]-1)];
108
-    }
109
-    return path;
110
-}
111
-/*
112
- * IN
113
- *  NSString localURI
114
- * OUT
115
- *  NSString full local filesystem path for the represented file or directory, or nil if no such path is possible
116
- *  The file or directory does not necessarily have to exist. nil is returned if the filesystem type is not recognized,
117
- *  or if the URL is malformed.
118
- * The incoming URI should be properly escaped (no raw spaces, etc. URI percent-encoding is expected).
119
- */
120
-- (NSString *)filesystemPathForURL:(CDVFilesystemURL *)url
121
-{
122
-    return [self filesystemPathForFullPath:url.fullPath];
123
-}
124
-
125
-- (CDVFilesystemURL *)URLforFullPath:(NSString *)fullPath
126
-{
127
-    if (fullPath) {
128
-        NSString* escapedPath = [fullPath stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
129
-        if ([fullPath hasPrefix:@"/"]) {
130
-            return [CDVFilesystemURL fileSystemURLWithString:[NSString stringWithFormat:@"%@://localhost/%@%@", kCDVFilesystemURLPrefix, self.name, escapedPath]];
131
-        }
132
-        return [CDVFilesystemURL fileSystemURLWithString:[NSString stringWithFormat:@"%@://localhost/%@/%@", kCDVFilesystemURLPrefix, self.name, escapedPath]];
133
-    }
134
-    return nil;
135
-}
136
-
137
-- (CDVFilesystemURL *)URLforFilesystemPath:(NSString *)path
138
-{
139
-    return [self URLforFullPath:[self fullPathForFileSystemPath:path]];
140
-
141
-}
142
-
143
-- (NSString *)normalizePath:(NSString *)rawPath
144
-{
145
-    // If this is an absolute path, the first path component will be '/'. Skip it if that's the case
146
-    BOOL isAbsolutePath = [rawPath hasPrefix:@"/"];
147
-    if (isAbsolutePath) {
148
-        rawPath = [rawPath substringFromIndex:1];
149
-    }
150
-    NSMutableArray *components = [NSMutableArray arrayWithArray:[rawPath pathComponents]];
151
-    for (int index = 0; index < [components count]; ++index) {
152
-        if ([[components objectAtIndex:index] isEqualToString:@".."]) {
153
-            [components removeObjectAtIndex:index];
154
-            if (index > 0) {
155
-                [components removeObjectAtIndex:index-1];
156
-                --index;
157
-            }
158
-        }
159
-    }
160
-
161
-    if (isAbsolutePath) {
162
-        return [NSString stringWithFormat:@"/%@", [components componentsJoinedByString:@"/"]];
163
-    } else {
164
-        return [components componentsJoinedByString:@"/"];
165
-    }
166
-
167
-
168
-}
169
-
170
-- (BOOL)valueForKeyIsNumber:(NSDictionary*)dict key:(NSString*)key
171
-{
172
-    BOOL bNumber = NO;
173
-    NSObject* value = dict[key];
174
-    if (value) {
175
-        bNumber = [value isKindOfClass:[NSNumber class]];
176
-    }
177
-    return bNumber;
178
-}
179
-
180
-- (CDVPluginResult *)getFileForURL:(CDVFilesystemURL *)baseURI requestedPath:(NSString *)requestedPath options:(NSDictionary *)options
181
-{
182
-    CDVPluginResult* result = nil;
183
-    BOOL bDirRequest = NO;
184
-    BOOL create = NO;
185
-    BOOL exclusive = NO;
186
-    int errorCode = 0;  // !!! risky - no error code currently defined for 0
187
-
188
-    if ([self valueForKeyIsNumber:options key:@"create"]) {
189
-        create = [(NSNumber*)[options valueForKey:@"create"] boolValue];
190
-    }
191
-    if ([self valueForKeyIsNumber:options key:@"exclusive"]) {
192
-        exclusive = [(NSNumber*)[options valueForKey:@"exclusive"] boolValue];
193
-    }
194
-    if ([self valueForKeyIsNumber:options key:@"getDir"]) {
195
-        // this will not exist for calls directly to getFile but will have been set by getDirectory before calling this method
196
-        bDirRequest = [(NSNumber*)[options valueForKey:@"getDir"] boolValue];
197
-    }
198
-    // see if the requested path has invalid characters - should we be checking for  more than just ":"?
199
-    if ([requestedPath rangeOfString:@":"].location != NSNotFound) {
200
-        errorCode = ENCODING_ERR;
201
-    } else {
202
-        // Build new fullPath for the requested resource.
203
-        // We concatenate the two paths together, and then scan the resulting string to remove
204
-        // parent ("..") references. Any parent references at the beginning of the string are
205
-        // silently removed.
206
-        NSString *combinedPath = [baseURI.fullPath stringByAppendingPathComponent:requestedPath];
207
-        combinedPath = [self normalizePath:combinedPath];
208
-        CDVFilesystemURL* requestedURL = [self URLforFullPath:combinedPath];
209
-
210
-        NSFileManager* fileMgr = [[NSFileManager alloc] init];
211
-        BOOL bIsDir;
212
-        BOOL bExists = [fileMgr fileExistsAtPath:[self filesystemPathForURL:requestedURL] isDirectory:&bIsDir];
213
-        if (bExists && (create == NO) && (bIsDir == !bDirRequest)) {
214
-            // path exists and is not of requested type  - return TYPE_MISMATCH_ERR
215
-            errorCode = TYPE_MISMATCH_ERR;
216
-        } else if (!bExists && (create == NO)) {
217
-            // path does not exist and create is false - return NOT_FOUND_ERR
218
-            errorCode = NOT_FOUND_ERR;
219
-        } else if (bExists && (create == YES) && (exclusive == YES)) {
220
-            // file/dir already exists and exclusive and create are both true - return PATH_EXISTS_ERR
221
-            errorCode = PATH_EXISTS_ERR;
222
-        } else {
223
-            // if bExists and create == YES - just return data
224
-            // if bExists and create == NO  - just return data
225
-            // if !bExists and create == YES - create and return data
226
-            BOOL bSuccess = YES;
227
-            NSError __autoreleasing* pError = nil;
228
-            if (!bExists && (create == YES)) {
229
-                if (bDirRequest) {
230
-                    // create the dir
231
-                    bSuccess = [fileMgr createDirectoryAtPath:[self filesystemPathForURL:requestedURL] withIntermediateDirectories:NO attributes:nil error:&pError];
232
-                } else {
233
-                    // create the empty file
234
-                    bSuccess = [fileMgr createFileAtPath:[self filesystemPathForURL:requestedURL] contents:nil attributes:nil];
235
-                }
236
-            }
237
-            if (!bSuccess) {
238
-                errorCode = ABORT_ERR;
239
-                if (pError) {
240
-                    NSLog(@"error creating directory: %@", [pError localizedDescription]);
241
-                }
242
-            } else {
243
-                // NSLog(@"newly created file/dir (%@) exists: %d", reqFullPath, [fileMgr fileExistsAtPath:reqFullPath]);
244
-                // file existed or was created
245
-                result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:[self makeEntryForPath:requestedURL.fullPath isDirectory:bDirRequest]];
246
-            }
247
-        } // are all possible conditions met?
248
-    }
249
-
250
-    if (errorCode > 0) {
251
-        // create error callback
252
-        result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:errorCode];
253
-    }
254
-    return result;
255
-
256
-}
257
-
258
-- (CDVPluginResult*)getParentForURL:(CDVFilesystemURL *)localURI
259
-{
260
-    CDVPluginResult* result = nil;
261
-    CDVFilesystemURL *newURI = nil;
262
-    if ([localURI.fullPath isEqualToString:@""]) {
263
-        // return self
264
-        newURI = localURI;
265
-    } else {
266
-        newURI = [CDVFilesystemURL fileSystemURLWithURL:[localURI.url URLByDeletingLastPathComponent]]; /* TODO: UGLY - FIX */
267
-    }
268
-    NSFileManager* fileMgr = [[NSFileManager alloc] init];
269
-    BOOL bIsDir;
270
-    BOOL bExists = [fileMgr fileExistsAtPath:[self filesystemPathForURL:newURI] isDirectory:&bIsDir];
271
-    if (bExists) {
272
-        result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:[self makeEntryForPath:newURI.fullPath isDirectory:bIsDir]];
273
-    } else {
274
-        // invalid path or file does not exist
275
-        result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:NOT_FOUND_ERR];
276
-    }
277
-    return result;
278
-}
279
-
280
-- (CDVPluginResult*)setMetadataForURL:(CDVFilesystemURL *)localURI withObject:(NSDictionary *)options
281
-{
282
-    BOOL ok = NO;
283
-
284
-    NSString* filePath = [self filesystemPathForURL:localURI];
285
-    // we only care about this iCloud key for now.
286
-    // set to 1/true to skip backup, set to 0/false to back it up (effectively removing the attribute)
287
-    NSString* iCloudBackupExtendedAttributeKey = @"com.apple.MobileBackup";
288
-    id iCloudBackupExtendedAttributeValue = [options objectForKey:iCloudBackupExtendedAttributeKey];
289
-
290
-    if ((iCloudBackupExtendedAttributeValue != nil) && [iCloudBackupExtendedAttributeValue isKindOfClass:[NSNumber class]]) {
291
-        if (IsAtLeastiOSVersion(@"5.1")) {
292
-            NSURL* url = [NSURL fileURLWithPath:filePath];
293
-            NSError* __autoreleasing error = nil;
294
-
295
-            ok = [url setResourceValue:[NSNumber numberWithBool:[iCloudBackupExtendedAttributeValue boolValue]] forKey:NSURLIsExcludedFromBackupKey error:&error];
296
-        } else { // below 5.1 (deprecated - only really supported in 5.01)
297
-            u_int8_t value = [iCloudBackupExtendedAttributeValue intValue];
298
-            if (value == 0) { // remove the attribute (allow backup, the default)
299
-                ok = (removexattr([filePath fileSystemRepresentation], [iCloudBackupExtendedAttributeKey cStringUsingEncoding:NSUTF8StringEncoding], 0) == 0);
300
-            } else { // set the attribute (skip backup)
301
-                ok = (setxattr([filePath fileSystemRepresentation], [iCloudBackupExtendedAttributeKey cStringUsingEncoding:NSUTF8StringEncoding], &value, sizeof(value), 0, 0) == 0);
302
-            }
303
-        }
304
-    }
305
-
306
-    if (ok) {
307
-        return [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
308
-    } else {
309
-        return [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR];
310
-    }
311
-}
312
-
313
-/* remove the file or directory (recursively)
314
- * IN:
315
- * NSString* fullPath - the full path to the file or directory to be removed
316
- * NSString* callbackId
317
- * called from remove and removeRecursively - check all pubic api specific error conditions (dir not empty, etc) before calling
318
- */
319
-
320
-- (CDVPluginResult*)doRemove:(NSString*)fullPath
321
-{
322
-    CDVPluginResult* result = nil;
323
-    BOOL bSuccess = NO;
324
-    NSError* __autoreleasing pError = nil;
325
-    NSFileManager* fileMgr = [[NSFileManager alloc] init];
326
-
327
-    @try {
328
-        bSuccess = [fileMgr removeItemAtPath:fullPath error:&pError];
329
-        if (bSuccess) {
330
-            result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
331
-        } else {
332
-            // see if we can give a useful error
333
-            CDVFileError errorCode = ABORT_ERR;
334
-            NSLog(@"error removing filesystem entry at %@: %@", fullPath, [pError localizedDescription]);
335
-            if ([pError code] == NSFileNoSuchFileError) {
336
-                errorCode = NOT_FOUND_ERR;
337
-            } else if ([pError code] == NSFileWriteNoPermissionError) {
338
-                errorCode = NO_MODIFICATION_ALLOWED_ERR;
339
-            }
340
-
341
-            result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:errorCode];
342
-        }
343
-    } @catch(NSException* e) {  // NSInvalidArgumentException if path is . or ..
344
-        result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsInt:SYNTAX_ERR];
345
-    }
346
-
347
-    return result;
348
-}
349
-
350
-- (CDVPluginResult *)removeFileAtURL:(CDVFilesystemURL *)localURI
351
-{
352
-    NSString *fileSystemPath = [self filesystemPathForURL:localURI];
353
-
354
-    NSFileManager* fileMgr = [[NSFileManager alloc] init];
355
-    BOOL bIsDir = NO;
356
-    BOOL bExists = [fileMgr fileExistsAtPath:fileSystemPath isDirectory:&bIsDir];
357
-    if (!bExists) {
358
-        return [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:NOT_FOUND_ERR];
359
-    }
360
-    if (bIsDir && ([[fileMgr contentsOfDirectoryAtPath:fileSystemPath error:nil] count] != 0)) {
361
-        // dir is not empty
362
-        return [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:INVALID_MODIFICATION_ERR];
363
-    }
364
-    return [self doRemove:fileSystemPath];
365
-}
366
-
367
-- (CDVPluginResult *)recursiveRemoveFileAtURL:(CDVFilesystemURL *)localURI
368
-{
369
-    NSString *fileSystemPath = [self filesystemPathForURL:localURI];
370
-    return [self doRemove:fileSystemPath];
371
-}
372
-
373
-/*
374
- * IN
375
- *  NSString localURI
376
- * OUT
377
- *  NSString full local filesystem path for the represented file or directory, or nil if no such path is possible
378
- *  The file or directory does not necessarily have to exist. nil is returned if the filesystem type is not recognized,
379
- *  or if the URL is malformed.
380
- * The incoming URI should be properly escaped (no raw spaces, etc. URI percent-encoding is expected).
381
- */
382
-- (NSString *)fullPathForFileSystemPath:(NSString *)fsPath
383
-{
384
-    if ([fsPath hasPrefix:self.fsRoot]) {
385
-        return [fsPath substringFromIndex:[self.fsRoot length]];
386
-    }
387
-    return nil;
388
-}
389
-
390
-
391
-- (CDVPluginResult *)readEntriesAtURL:(CDVFilesystemURL *)localURI
392
-{
393
-    NSFileManager* fileMgr = [[NSFileManager alloc] init];
394
-    NSError* __autoreleasing error = nil;
395
-    NSString *fileSystemPath = [self filesystemPathForURL:localURI];
396
-
397
-    NSArray* contents = [fileMgr contentsOfDirectoryAtPath:fileSystemPath error:&error];
398
-
399
-    if (contents) {
400
-        NSMutableArray* entries = [NSMutableArray arrayWithCapacity:1];
401
-        if ([contents count] > 0) {
402
-            // create an Entry (as JSON) for each file/dir
403
-            for (NSString* name in contents) {
404
-                // see if is dir or file
405
-                NSString* entryPath = [fileSystemPath stringByAppendingPathComponent:name];
406
-                BOOL bIsDir = NO;
407
-                [fileMgr fileExistsAtPath:entryPath isDirectory:&bIsDir];
408
-                NSDictionary* entryDict = [self makeEntryForPath:[self fullPathForFileSystemPath:entryPath] isDirectory:bIsDir];
409
-                [entries addObject:entryDict];
410
-            }
411
-        }
412
-        return [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsArray:entries];
413
-    } else {
414
-        // assume not found but could check error for more specific error conditions
415
-        return [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:NOT_FOUND_ERR];
416
-    }
417
-}
418
-
419
-- (unsigned long long)truncateFile:(NSString*)filePath atPosition:(unsigned long long)pos
420
-{
421
-    unsigned long long newPos = 0UL;
422
-
423
-    NSFileHandle* file = [NSFileHandle fileHandleForWritingAtPath:filePath];
424
-
425
-    if (file) {
426
-        [file truncateFileAtOffset:(unsigned long long)pos];
427
-        newPos = [file offsetInFile];
428
-        [file synchronizeFile];
429
-        [file closeFile];
430
-    }
431
-    return newPos;
432
-}
433
-
434
-- (CDVPluginResult *)truncateFileAtURL:(CDVFilesystemURL *)localURI atPosition:(unsigned long long)pos
435
-{
436
-    unsigned long long newPos = [self truncateFile:[self filesystemPathForURL:localURI] atPosition:pos];
437
-    return [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt:(int)newPos];
438
-}
439
-
440
-- (CDVPluginResult *)writeToFileAtURL:(CDVFilesystemURL *)localURL withData:(NSData*)encData append:(BOOL)shouldAppend
441
-{
442
-    NSString *filePath = [self filesystemPathForURL:localURL];
443
-
444
-    CDVPluginResult* result = nil;
445
-    CDVFileError errCode = INVALID_MODIFICATION_ERR;
446
-    int bytesWritten = 0;
447
-
448
-    if (filePath) {
449
-        NSOutputStream* fileStream = [NSOutputStream outputStreamToFileAtPath:filePath append:shouldAppend];
450
-        if (fileStream) {
451
-            NSUInteger len = [encData length];
452
-            if (len == 0) {
453
-                result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDouble:(double)len];
454
-            } else {
455
-                [fileStream open];
456
-
457
-                bytesWritten = (int)[fileStream write:[encData bytes] maxLength:len];
458
-
459
-                [fileStream close];
460
-                if (bytesWritten > 0) {
461
-                    result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt:bytesWritten];
462
-                    // } else {
463
-                    // can probably get more detailed error info via [fileStream streamError]
464
-                    // errCode already set to INVALID_MODIFICATION_ERR;
465
-                    // bytesWritten = 0; // may be set to -1 on error
466
-                }
467
-            }
468
-        } // else fileStream not created return INVALID_MODIFICATION_ERR
469
-    } else {
470
-        // invalid filePath
471
-        errCode = NOT_FOUND_ERR;
472
-    }
473
-    if (!result) {
474
-        // was an error
475
-        result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsInt:errCode];
476
-    }
477
-    return result;
478
-}
479
-
480
-/**
481
- * Helper function to check to see if the user attempted to copy an entry into its parent without changing its name,
482
- * or attempted to copy a directory into a directory that it contains directly or indirectly.
483
- *
484
- * IN:
485
- *  NSString* srcDir
486
- *  NSString* destinationDir
487
- * OUT:
488
- *  YES copy/ move is allows
489
- *  NO move is onto itself
490
- */
491
-- (BOOL)canCopyMoveSrc:(NSString*)src ToDestination:(NSString*)dest
492
-{
493
-    // This weird test is to determine if we are copying or moving a directory into itself.
494
-    // Copy /Documents/myDir to /Documents/myDir-backup is okay but
495
-    // Copy /Documents/myDir to /Documents/myDir/backup not okay
496
-    BOOL copyOK = YES;
497
-    NSRange range = [dest rangeOfString:src];
498
-
499
-    if (range.location != NSNotFound) {
500
-        NSRange testRange = {range.length - 1, ([dest length] - range.length)};
501
-        NSRange resultRange = [dest rangeOfString:@"/" options:0 range:testRange];
502
-        if (resultRange.location != NSNotFound) {
503
-            copyOK = NO;
504
-        }
505
-    }
506
-    return copyOK;
507
-}
508
-
509
-- (void)copyFileToURL:(CDVFilesystemURL *)destURL withName:(NSString *)newName fromFileSystem:(NSObject<CDVFileSystem> *)srcFs atURL:(CDVFilesystemURL *)srcURL copy:(BOOL)bCopy callback:(void (^)(CDVPluginResult *))callback
510
-{
511
-    NSFileManager *fileMgr = [[NSFileManager alloc] init];
512
-    NSString *destRootPath = [self filesystemPathForURL:destURL];
513
-    BOOL bDestIsDir = NO;
514
-    BOOL bDestExists = [fileMgr fileExistsAtPath:destRootPath isDirectory:&bDestIsDir];
515
-
516
-    NSString *newFileSystemPath = [destRootPath stringByAppendingPathComponent:newName];
517
-    NSString *newFullPath = [self fullPathForFileSystemPath:newFileSystemPath];
518
-
519
-    BOOL bNewIsDir = NO;
520
-    BOOL bNewExists = [fileMgr fileExistsAtPath:newFileSystemPath isDirectory:&bNewIsDir];
521
-
522
-    CDVPluginResult *result = nil;
523
-    int errCode = 0;
524
-
525
-    if (!bDestExists) {
526
-        // the destination root does not exist
527
-        errCode = NOT_FOUND_ERR;
528
-    }
529
-
530
-    else if ([srcFs isKindOfClass:[CDVLocalFilesystem class]]) {
531
-        /* Same FS, we can shortcut with NSFileManager operations */
532
-        NSString *srcFullPath = [srcFs filesystemPathForURL:srcURL];
533
-
534
-        BOOL bSrcIsDir = NO;
535
-        BOOL bSrcExists = [fileMgr fileExistsAtPath:srcFullPath isDirectory:&bSrcIsDir];
536
-
537
-        if (!bSrcExists) {
538
-            // the source does not exist
539
-            errCode = NOT_FOUND_ERR;
540
-        } else if ([newFileSystemPath isEqualToString:srcFullPath]) {
541
-            // source and destination can not be the same
542
-            errCode = INVALID_MODIFICATION_ERR;
543
-        } else if (bSrcIsDir && (bNewExists && !bNewIsDir)) {
544
-            // can't copy/move dir to file
545
-            errCode = INVALID_MODIFICATION_ERR;
546
-        } else { // no errors yet
547
-            NSError* __autoreleasing error = nil;
548
-            BOOL bSuccess = NO;
549
-            if (bCopy) {
550
-                if (bSrcIsDir && ![self canCopyMoveSrc:srcFullPath ToDestination:newFileSystemPath]) {
551
-                    // can't copy dir into self
552
-                    errCode = INVALID_MODIFICATION_ERR;
553
-                } else if (bNewExists) {
554
-                    // the full destination should NOT already exist if a copy
555
-                    errCode = PATH_EXISTS_ERR;
556
-                } else {
557
-                    bSuccess = [fileMgr copyItemAtPath:srcFullPath toPath:newFileSystemPath error:&error];
558
-                }
559
-            } else { // move
560
-                // iOS requires that destination must not exist before calling moveTo
561
-                // is W3C INVALID_MODIFICATION_ERR error if destination dir exists and has contents
562
-                //
563
-                if (!bSrcIsDir && (bNewExists && bNewIsDir)) {
564
-                    // can't move a file to directory
565
-                    errCode = INVALID_MODIFICATION_ERR;
566
-                } else if (bSrcIsDir && ![self canCopyMoveSrc:srcFullPath ToDestination:newFileSystemPath]) {
567
-                    // can't move a dir into itself
568
-                    errCode = INVALID_MODIFICATION_ERR;
569
-                } else if (bNewExists) {
570
-                    if (bNewIsDir && ([[fileMgr contentsOfDirectoryAtPath:newFileSystemPath error:NULL] count] != 0)) {
571
-                        // can't move dir to a dir that is not empty
572
-                        errCode = INVALID_MODIFICATION_ERR;
573
-                        newFileSystemPath = nil;  // so we won't try to move
574
-                    } else {
575
-                        // remove destination so can perform the moveItemAtPath
576
-                        bSuccess = [fileMgr removeItemAtPath:newFileSystemPath error:NULL];
577
-                        if (!bSuccess) {
578
-                            errCode = INVALID_MODIFICATION_ERR; // is this the correct error?
579
-                            newFileSystemPath = nil;
580
-                        }
581
-                    }
582
-                } else if (bNewIsDir && [newFileSystemPath hasPrefix:srcFullPath]) {
583
-                    // can't move a directory inside itself or to any child at any depth;
584
-                    errCode = INVALID_MODIFICATION_ERR;
585
-                    newFileSystemPath = nil;
586
-                }
587
-
588
-                if (newFileSystemPath != nil) {
589
-                    bSuccess = [fileMgr moveItemAtPath:srcFullPath toPath:newFileSystemPath error:&error];
590
-                }
591
-            }
592
-            if (bSuccess) {
593
-                // should verify it is there and of the correct type???
594
-                NSDictionary* newEntry = [self makeEntryForPath:newFullPath isDirectory:bSrcIsDir];
595
-                result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:newEntry];
596
-            } else {
597
-                if (error) {
598
-                    if (([error code] == NSFileReadUnknownError) || ([error code] == NSFileReadTooLargeError)) {
599
-                        errCode = NOT_READABLE_ERR;
600
-                    } else if ([error code] == NSFileWriteOutOfSpaceError) {
601
-                        errCode = QUOTA_EXCEEDED_ERR;
602
-                    } else if ([error code] == NSFileWriteNoPermissionError) {
603
-                        errCode = NO_MODIFICATION_ALLOWED_ERR;
604
-                    }
605
-                }
606
-            }
607
-        }
608
-    } else {
609
-        // Need to copy the hard way
610
-        [srcFs readFileAtURL:srcURL start:0 end:-1 callback:^(NSData* data, NSString* mimeType, CDVFileError errorCode) {
611
-            CDVPluginResult* result = nil;
612
-            if (data != nil) {
613
-                BOOL bSuccess = [data writeToFile:newFileSystemPath atomically:YES];
614
-                if (bSuccess) {
615
-                    // should verify it is there and of the correct type???
616
-                    NSDictionary* newEntry = [self makeEntryForPath:newFullPath isDirectory:NO];
617
-                    result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:newEntry];
618
-                } else {
619
-                    result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:ABORT_ERR];
620
-                }
621
-            } else {
622
-                result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:errorCode];
623
-            }
624
-            callback(result);
625
-        }];
626
-        return; // Async IO; return without callback.
627
-    }
628
-    if (result == nil) {
629
-        if (!errCode) {
630
-            errCode = INVALID_MODIFICATION_ERR; // Catch-all default
631
-        }
632
-        result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:errCode];
633
-    }
634
-    callback(result);
635
-}
636
-
637
-/* helper function to get the mimeType from the file extension
638
- * IN:
639
- *	NSString* fullPath - filename (may include path)
640
- * OUT:
641
- *	NSString* the mime type as type/subtype.  nil if not able to determine
642
- */
643
-+ (NSString*)getMimeTypeFromPath:(NSString*)fullPath
644
-{
645
-    NSString* mimeType = nil;
646
-
647
-    if (fullPath) {
648
-        CFStringRef typeId = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (__bridge CFStringRef)[fullPath pathExtension], NULL);
649
-        if (typeId) {
650
-            mimeType = (__bridge_transfer NSString*)UTTypeCopyPreferredTagWithClass(typeId, kUTTagClassMIMEType);
651
-            if (!mimeType) {
652
-                // special case for m4a
653
-                if ([(__bridge NSString*)typeId rangeOfString : @"m4a-audio"].location != NSNotFound) {
654
-                    mimeType = @"audio/mp4";
655
-                } else if ([[fullPath pathExtension] rangeOfString:@"wav"].location != NSNotFound) {
656
-                    mimeType = @"audio/wav";
657
-                } else if ([[fullPath pathExtension] rangeOfString:@"css"].location != NSNotFound) {
658
-                    mimeType = @"text/css";
659
-                }
660
-            }
661
-            CFRelease(typeId);
662
-        }
663
-    }
664
-    return mimeType;
665
-}
666
-
667
-- (void)readFileAtURL:(CDVFilesystemURL *)localURL start:(NSInteger)start end:(NSInteger)end callback:(void (^)(NSData*, NSString* mimeType, CDVFileError))callback
668
-{
669
-    NSString *path = [self filesystemPathForURL:localURL];
670
-
671
-    NSString* mimeType = [CDVLocalFilesystem getMimeTypeFromPath:path];
672
-    if (mimeType == nil) {
673
-        mimeType = @"*/*";
674
-    }
675
-    NSFileHandle* file = [NSFileHandle fileHandleForReadingAtPath:path];
676
-    if (start > 0) {
677
-        [file seekToFileOffset:start];
678
-    }
679
-
680
-    NSData* readData;
681
-    if (end < 0) {
682
-        readData = [file readDataToEndOfFile];
683
-    } else {
684
-        readData = [file readDataOfLength:(end - start)];
685
-    }
686
-    [file closeFile];
687
-
688
-    callback(readData, mimeType, readData != nil ? NO_ERROR : NOT_FOUND_ERR);
689
-}
690
-
691
-- (void)getFileMetadataForURL:(CDVFilesystemURL *)localURL callback:(void (^)(CDVPluginResult *))callback
692
-{
693
-    NSString *path = [self filesystemPathForURL:localURL];
694
-    CDVPluginResult *result;
695
-    NSFileManager* fileMgr = [[NSFileManager alloc] init];
696
-
697
-    NSError* __autoreleasing error = nil;
698
-    NSDictionary* fileAttrs = [fileMgr attributesOfItemAtPath:path error:&error];
699
-
700
-    if (fileAttrs) {
701
-
702
-        // create dictionary of file info
703
-        NSMutableDictionary* fileInfo = [NSMutableDictionary dictionaryWithCapacity:5];
704
-
705
-        [fileInfo setObject:localURL.fullPath forKey:@"fullPath"];
706
-        [fileInfo setObject:[self mimeTypeForFileAtPath: path] forKey:@"type"];
707
-        [fileInfo setObject:[path lastPathComponent] forKey:@"name"];
708
-
709
-        // Ensure that directories (and other non-regular files) report size of 0
710
-        unsigned long long size = ([fileAttrs fileType] == NSFileTypeRegular ? [fileAttrs fileSize] : 0);
711
-        [fileInfo setObject:[NSNumber numberWithUnsignedLongLong:size] forKey:@"size"];
712
-
713
-        NSDate* modDate = [fileAttrs fileModificationDate];
714
-        if (modDate) {
715
-            [fileInfo setObject:[NSNumber numberWithDouble:[modDate timeIntervalSince1970] * 1000] forKey:@"lastModifiedDate"];
716
-        }
717
-
718
-        result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:fileInfo];
719
-
720
-    } else {
721
-        // didn't get fileAttribs
722
-        CDVFileError errorCode = ABORT_ERR;
723
-        NSLog(@"error getting metadata: %@", [error localizedDescription]);
724
-        if ([error code] == NSFileNoSuchFileError || [error code] == NSFileReadNoSuchFileError) {
725
-            errorCode = NOT_FOUND_ERR;
726
-        }
727
-        // log [NSNumber numberWithDouble: theMessage] objCtype to see what it returns
728
-        result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsInt:errorCode];
729
-    }
730
-
731
-    callback(result);
732
-}
733
-
734
-// fix errors that base on Alexsander Akers from http://stackoverflow.com/a/5998683/2613194
735
-- (NSString*) mimeTypeForFileAtPath: (NSString *) path {
736
-    if (![[NSFileManager defaultManager] fileExistsAtPath:path]) {
737
-        return nil;
738
-    }
739
-    
740
-    CFStringRef UTI = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (__bridge CFStringRef)[path pathExtension], NULL);
741
-    CFStringRef mimeType = UTTypeCopyPreferredTagWithClass (UTI, kUTTagClassMIMEType);
742
-    CFRelease(UTI);
743
-    
744
-    if (!mimeType) {
745
-        return @"application/octet-stream";
746
-    }
747
-    return (__bridge NSString *)mimeType;
748
-}
749
-
750
-@end

+ 0
- 189
node_modules/cordova-plugin-file/src/osx/CDVFile.h Datei anzeigen

@@ -1,189 +0,0 @@
1
-/*
2
- Licensed to the Apache Software Foundation (ASF) under one
3
- or more contributor license agreements.  See the NOTICE file
4
- distributed with this work for additional information
5
- regarding copyright ownership.  The ASF licenses this file
6
- to you under the Apache License, Version 2.0 (the
7
- "License"); you may not use this file except in compliance
8
- with the License.  You may obtain a copy of the License at
9
-
10
- http://www.apache.org/licenses/LICENSE-2.0
11
-
12
- Unless required by applicable law or agreed to in writing,
13
- software distributed under the License is distributed on an
14
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
- KIND, either express or implied.  See the License for the
16
- specific language governing permissions and limitations
17
- under the License.
18
- */
19
-
20
-#import <Foundation/Foundation.h>
21
-#import <Cordova/CDVPlugin.h>
22
-
23
-NSString* const kCDVFilesystemURLPrefix;
24
-
25
-/**
26
-* The default filesystems if non are specified.
27
-*/
28
-#define CDV_FILESYSTEMS_DEFAULT @"documents,cache,bundle,root"
29
-
30
-/**
31
-* Preference name of the extra filesystems to be "mounted". the following are supported:
32
-* 'bundle'    - mounts the application directory
33
-* 'documents' - mounts the users Documents directory (~/Documents)
34
-* 'root'      - mounts the root file system
35
-* 'cache'     - mounts the caches directory (~/Library/Caches/<bundle-id/)
36
-*/
37
-#define CDV_PREF_EXTRA_FILESYSTEM @"osxextrafilesystems"
38
-
39
-enum CDVFileError {
40
-    NO_ERROR = 0,
41
-    NOT_FOUND_ERR = 1,
42
-    SECURITY_ERR = 2,
43
-    ABORT_ERR = 3,
44
-    NOT_READABLE_ERR = 4,
45
-    ENCODING_ERR = 5,
46
-    NO_MODIFICATION_ALLOWED_ERR = 6,
47
-    INVALID_STATE_ERR = 7,
48
-    SYNTAX_ERR = 8,
49
-    INVALID_MODIFICATION_ERR = 9,
50
-    QUOTA_EXCEEDED_ERR = 10,
51
-    TYPE_MISMATCH_ERR = 11,
52
-    PATH_EXISTS_ERR = 12
53
-};
54
-typedef int CDVFileError;
55
-
56
-@interface CDVFilesystemURL : NSObject  {
57
-    NSURL *_url;
58
-    NSString *_fileSystemName;
59
-    NSString *_fullPath;
60
-}
61
-
62
-- (id) initWithString:(NSString*)strURL;
63
-- (id) initWithURL:(NSURL*)URL;
64
-+ (CDVFilesystemURL *)fileSystemURLWithString:(NSString *)strURL;
65
-+ (CDVFilesystemURL *)fileSystemURLWithURL:(NSURL *)URL;
66
-
67
-- (NSString *)absoluteURL;
68
-
69
-@property (atomic) NSURL *url;
70
-@property (atomic) NSString *fileSystemName;
71
-@property (atomic) NSString *fullPath;
72
-
73
-@end
74
-
75
-@interface CDVFilesystemURLProtocol : NSURLProtocol
76
-@end
77
-
78
-@protocol CDVFileSystem
79
-- (CDVPluginResult *)entryForLocalURI:(CDVFilesystemURL *)url;
80
-- (CDVPluginResult *)getFileForURL:(CDVFilesystemURL *)baseURI requestedPath:(NSString *)requestedPath options:(NSDictionary *)options;
81
-- (CDVPluginResult *)getParentForURL:(CDVFilesystemURL *)localURI;
82
-- (CDVPluginResult *)setMetadataForURL:(CDVFilesystemURL *)localURI withObject:(NSDictionary *)options;
83
-- (CDVPluginResult *)removeFileAtURL:(CDVFilesystemURL *)localURI;
84
-- (CDVPluginResult *)recursiveRemoveFileAtURL:(CDVFilesystemURL *)localURI;
85
-- (CDVPluginResult *)readEntriesAtURL:(CDVFilesystemURL *)localURI;
86
-- (CDVPluginResult *)truncateFileAtURL:(CDVFilesystemURL *)localURI atPosition:(unsigned long long)pos;
87
-- (CDVPluginResult *)writeToFileAtURL:(CDVFilesystemURL *)localURL withData:(NSData*)encData append:(BOOL)shouldAppend;
88
-- (void)copyFileToURL:(CDVFilesystemURL *)destURL withName:(NSString *)newName fromFileSystem:(NSObject<CDVFileSystem> *)srcFs atURL:(CDVFilesystemURL *)srcURL copy:(BOOL)bCopy callback:(void (^)(CDVPluginResult *))callback;
89
-- (void)readFileAtURL:(CDVFilesystemURL *)localURL start:(NSInteger)start end:(NSInteger)end callback:(void (^)(NSData*, NSString* mimeType, CDVFileError))callback;
90
-- (void)getFileMetadataForURL:(CDVFilesystemURL *)localURL callback:(void (^)(CDVPluginResult *))callback;
91
-
92
-- (NSDictionary *)makeEntryForLocalURL:(CDVFilesystemURL *)url;
93
-- (NSDictionary*)makeEntryForPath:(NSString*)fullPath isDirectory:(BOOL)isDir;
94
-
95
-@property (nonatomic,strong) NSString *name;
96
-@property (nonatomic, copy) NSURL*(^urlTransformer)(NSURL*);
97
-
98
-@optional
99
-- (NSString *)filesystemPathForURL:(CDVFilesystemURL *)localURI;
100
-- (CDVFilesystemURL *)URLforFilesystemPath:(NSString *)path;
101
-
102
-@end
103
-
104
-@interface CDVFile : CDVPlugin {
105
-    NSString* rootDocsPath;
106
-    NSString* appDocsPath;
107
-    NSString* appLibraryPath;
108
-    NSString* appTempPath;
109
-
110
-    NSMutableArray* fileSystems_;
111
-    BOOL userHasAllowed;
112
-}
113
-
114
-- (NSNumber*)checkFreeDiskSpace:(NSString*)appPath;
115
-- (NSDictionary*)makeEntryForPath:(NSString*)fullPath fileSystemName:(NSString *)fsName isDirectory:(BOOL)isDir;
116
-- (NSDictionary *)makeEntryForURL:(NSURL *)URL;
117
-- (CDVFilesystemURL *)fileSystemURLforLocalPath:(NSString *)localPath;
118
-
119
-- (NSObject<CDVFileSystem> *)filesystemForURL:(CDVFilesystemURL *)localURL;
120
-
121
-/* Native Registration API */
122
-- (void)registerFilesystem:(NSObject<CDVFileSystem> *)fs;
123
-- (NSObject<CDVFileSystem> *)fileSystemByName:(NSString *)fsName;
124
-
125
-/* Exec API */
126
-- (void)requestFileSystem:(CDVInvokedUrlCommand*)command;
127
-- (void)resolveLocalFileSystemURI:(CDVInvokedUrlCommand*)command;
128
-- (void)getDirectory:(CDVInvokedUrlCommand*)command;
129
-- (void)getFile:(CDVInvokedUrlCommand*)command;
130
-- (void)getParent:(CDVInvokedUrlCommand*)command;
131
-- (void)removeRecursively:(CDVInvokedUrlCommand*)command;
132
-- (void)remove:(CDVInvokedUrlCommand*)command;
133
-- (void)copyTo:(CDVInvokedUrlCommand*)command;
134
-- (void)moveTo:(CDVInvokedUrlCommand*)command;
135
-- (void)getFileMetadata:(CDVInvokedUrlCommand*)command;
136
-- (void)readEntries:(CDVInvokedUrlCommand*)command;
137
-- (void)readAsText:(CDVInvokedUrlCommand*)command;
138
-- (void)readAsDataURL:(CDVInvokedUrlCommand*)command;
139
-- (void)readAsArrayBuffer:(CDVInvokedUrlCommand*)command;
140
-- (void)write:(CDVInvokedUrlCommand*)command;
141
-- (void)testFileExists:(CDVInvokedUrlCommand*)command;
142
-- (void)testDirectoryExists:(CDVInvokedUrlCommand*)command;
143
-- (void)getFreeDiskSpace:(CDVInvokedUrlCommand*)command;
144
-- (void)truncate:(CDVInvokedUrlCommand*)command;
145
-- (void)doCopyMove:(CDVInvokedUrlCommand*)command isCopy:(BOOL)bCopy;
146
-
147
-/* Compatibilty with older File API */
148
-- (NSString*)getMimeTypeFromPath:(NSString*)fullPath;
149
-- (NSDictionary *)getDirectoryEntry:(NSString *)target isDirectory:(BOOL)bDirRequest;
150
-
151
-/* Conversion between filesystem paths and URLs */
152
-- (NSString *)filesystemPathForURL:(CDVFilesystemURL *)URL;
153
-
154
-/* Internal methods for testing */
155
-- (void)_getLocalFilesystemPath:(CDVInvokedUrlCommand*)command;
156
-
157
-/**
158
- * local path of the 'documents' file system (~/Documents)
159
- */
160
-@property (nonatomic, strong) NSString* appDocsPath;
161
-
162
-/**
163
-* local path of the 'applicationStorageDirectory' file system (~/Library/Application Support/<bundle-id>)
164
-*/
165
-@property (nonatomic, strong) NSString* appSupportPath;
166
-
167
-/**
168
-* local path of the 'persistent' file system (~/Library/Application Support/<bundle-id>/files)
169
-*/
170
-@property (nonatomic, strong) NSString* appDataPath;
171
-
172
-/**
173
-* local path of the 'documents' file system (~/Documents)
174
-*/
175
-@property (nonatomic, strong) NSString* appTempPath;
176
-
177
-/**
178
-* local path of the 'cache' file system (~/Library/Caches/<bundle-id>)
179
-*/
180
-@property (nonatomic, strong) NSString* appCachePath;
181
-
182
-/**
183
- * registered file systems
184
- */
185
-@property (nonatomic, strong) NSMutableArray* fileSystems;
186
-
187
-@property BOOL userHasAllowed;
188
-
189
-@end

+ 0
- 1056
node_modules/cordova-plugin-file/src/osx/CDVFile.m
Datei-Diff unterdrückt, da er zu groß ist
Datei anzeigen


+ 0
- 32
node_modules/cordova-plugin-file/src/osx/CDVLocalFilesystem.h Datei anzeigen

@@ -1,32 +0,0 @@
1
-/*
2
- Licensed to the Apache Software Foundation (ASF) under one
3
- or more contributor license agreements.  See the NOTICE file
4
- distributed with this work for additional information
5
- regarding copyright ownership.  The ASF licenses this file
6
- to you under the Apache License, Version 2.0 (the
7
- "License"); you may not use this file except in compliance
8
- with the License.  You may obtain a copy of the License at
9
-
10
- http://www.apache.org/licenses/LICENSE-2.0
11
-
12
- Unless required by applicable law or agreed to in writing,
13
- software distributed under the License is distributed on an
14
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
- KIND, either express or implied.  See the License for the
16
- specific language governing permissions and limitations
17
- under the License.
18
- */
19
-
20
-#import "CDVFile.h"
21
-
22
-@interface CDVLocalFilesystem : NSObject<CDVFileSystem> {
23
-    NSString *_name;
24
-    NSString *_fsRoot;
25
-}
26
-
27
-- (id) initWithName:(NSString *)name root:(NSString *)fsRoot;
28
-+ (NSString*)getMimeTypeFromPath:(NSString*)fullPath;
29
-
30
-@property (nonatomic,strong) NSString *fsRoot;
31
-
32
-@end

+ 0
- 733
node_modules/cordova-plugin-file/src/osx/CDVLocalFilesystem.m Datei anzeigen

@@ -1,733 +0,0 @@
1
-/*
2
- Licensed to the Apache Software Foundation (ASF) under one
3
- or more contributor license agreements.  See the NOTICE file
4
- distributed with this work for additional information
5
- regarding copyright ownership.  The ASF licenses this file
6
- to you under the Apache License, Version 2.0 (the
7
- "License"); you may not use this file except in compliance
8
- with the License.  You may obtain a copy of the License at
9
-
10
- http://www.apache.org/licenses/LICENSE-2.0
11
-
12
- Unless required by applicable law or agreed to in writing,
13
- software distributed under the License is distributed on an
14
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
- KIND, either express or implied.  See the License for the
16
- specific language governing permissions and limitations
17
- under the License.
18
- */
19
-
20
-#import "CDVFile.h"
21
-#import "CDVLocalFilesystem.h"
22
-#import <sys/xattr.h>
23
-
24
-@implementation CDVLocalFilesystem
25
-@synthesize name=_name, fsRoot=_fsRoot, urlTransformer;
26
-
27
-- (id) initWithName:(NSString *)name root:(NSString *)fsRoot
28
-{
29
-    if (self) {
30
-        _name = name;
31
-        _fsRoot = fsRoot;
32
-    }
33
-    return self;
34
-}
35
-
36
-/*
37
- * IN
38
- *  NSString localURI
39
- * OUT
40
- *  CDVPluginResult result containing a file or directoryEntry for the localURI, or an error if the
41
- *   URI represents a non-existent path, or is unrecognized or otherwise malformed.
42
- */
43
-- (CDVPluginResult *)entryForLocalURI:(CDVFilesystemURL *)url
44
-{
45
-    CDVPluginResult* result = nil;
46
-    NSDictionary* entry = [self makeEntryForLocalURL:url];
47
-    if (entry) {
48
-        result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:entry];
49
-    } else {
50
-        // return NOT_FOUND_ERR
51
-        result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:NOT_FOUND_ERR];
52
-    }
53
-    return result;
54
-}
55
-- (NSDictionary *)makeEntryForLocalURL:(CDVFilesystemURL *)url {
56
-    NSString *path = [self filesystemPathForURL:url];
57
-    NSFileManager* fileMgr = [[NSFileManager alloc] init];
58
-    BOOL isDir = NO;
59
-    // see if exists and is file or dir
60
-    BOOL bExists = [fileMgr fileExistsAtPath:path isDirectory:&isDir];
61
-    if (bExists) {
62
-        return [self makeEntryForPath:url.fullPath isDirectory:isDir];
63
-    } else {
64
-        return nil;
65
-    }
66
-}
67
-- (NSDictionary*)makeEntryForPath:(NSString*)fullPath isDirectory:(BOOL)isDir
68
-{
69
-    NSMutableDictionary* dirEntry = [NSMutableDictionary dictionaryWithCapacity:5];
70
-    NSString* lastPart = [[self stripQueryParametersFromPath:fullPath] lastPathComponent];
71
-    if (isDir && ![fullPath hasSuffix:@"/"]) {
72
-        fullPath = [fullPath stringByAppendingString:@"/"];
73
-    }
74
-    [dirEntry setObject:[NSNumber numberWithBool:!isDir]  forKey:@"isFile"];
75
-    [dirEntry setObject:[NSNumber numberWithBool:isDir]  forKey:@"isDirectory"];
76
-    [dirEntry setObject:fullPath forKey:@"fullPath"];
77
-    [dirEntry setObject:lastPart forKey:@"name"];
78
-    [dirEntry setObject:self.name forKey: @"filesystemName"];
79
-
80
-    NSURL* nativeURL = [NSURL fileURLWithPath:[self filesystemPathForFullPath:fullPath]];
81
-    if (self.urlTransformer) {
82
-        nativeURL = self.urlTransformer(nativeURL);
83
-    }
84
-
85
-    dirEntry[@"nativeURL"] = [nativeURL absoluteString];
86
-
87
-    return dirEntry;
88
-}
89
-
90
-- (NSString *)stripQueryParametersFromPath:(NSString *)fullPath
91
-{
92
-    NSRange questionMark = [fullPath rangeOfString:@"?"];
93
-    if (questionMark.location != NSNotFound) {
94
-        return [fullPath substringWithRange:NSMakeRange(0,questionMark.location)];
95
-    }
96
-    return fullPath;
97
-}
98
-
99
-- (NSString *)filesystemPathForFullPath:(NSString *)fullPath
100
-{
101
-    NSString *path = nil;
102
-    NSString *strippedFullPath = [self stripQueryParametersFromPath:fullPath];
103
-    path = [NSString stringWithFormat:@"%@%@", self.fsRoot, strippedFullPath];
104
-    if ([path length] > 1 && [path hasSuffix:@"/"]) {
105
-      path = [path substringToIndex:([path length]-1)];
106
-    }
107
-    return path;
108
-}
109
-/*
110
- * IN
111
- *  NSString localURI
112
- * OUT
113
- *  NSString full local filesystem path for the represented file or directory, or nil if no such path is possible
114
- *  The file or directory does not necessarily have to exist. nil is returned if the filesystem type is not recognized,
115
- *  or if the URL is malformed.
116
- * The incoming URI should be properly escaped (no raw spaces, etc. URI percent-encoding is expected).
117
- */
118
-- (NSString *)filesystemPathForURL:(CDVFilesystemURL *)url
119
-{
120
-    return [self filesystemPathForFullPath:url.fullPath];
121
-}
122
-
123
-- (CDVFilesystemURL *)URLforFullPath:(NSString *)fullPath
124
-{
125
-    if (fullPath) {
126
-        NSString* escapedPath = [fullPath stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
127
-        if ([fullPath hasPrefix:@"/"]) {
128
-            return [CDVFilesystemURL fileSystemURLWithString:[NSString stringWithFormat:@"%@://localhost/%@%@", kCDVFilesystemURLPrefix, self.name, escapedPath]];
129
-        }
130
-        return [CDVFilesystemURL fileSystemURLWithString:[NSString stringWithFormat:@"%@://localhost/%@/%@", kCDVFilesystemURLPrefix, self.name, escapedPath]];
131
-    }
132
-    return nil;
133
-}
134
-
135
-- (CDVFilesystemURL *)URLforFilesystemPath:(NSString *)path
136
-{
137
-    return [self URLforFullPath:[self fullPathForFileSystemPath:path]];
138
-
139
-}
140
-
141
-- (NSString *)normalizePath:(NSString *)rawPath
142
-{
143
-    // If this is an absolute path, the first path component will be '/'. Skip it if that's the case
144
-    BOOL isAbsolutePath = [rawPath hasPrefix:@"/"];
145
-    if (isAbsolutePath) {
146
-        rawPath = [rawPath substringFromIndex:1];
147
-    }
148
-    NSMutableArray *components = [NSMutableArray arrayWithArray:[rawPath pathComponents]];
149
-    for (int index = 0; index < [components count]; ++index) {
150
-        if ([[components objectAtIndex:index] isEqualToString:@".."]) {
151
-            [components removeObjectAtIndex:index];
152
-            if (index > 0) {
153
-                [components removeObjectAtIndex:index-1];
154
-                --index;
155
-            }
156
-        }
157
-    }
158
-
159
-    if (isAbsolutePath) {
160
-        return [NSString stringWithFormat:@"/%@", [components componentsJoinedByString:@"/"]];
161
-    } else {
162
-        return [components componentsJoinedByString:@"/"];
163
-    }
164
-
165
-
166
-}
167
-
168
-- (BOOL)valueForKeyIsNumber:(NSDictionary*)dict key:(NSString*)key
169
-{
170
-    BOOL bNumber = NO;
171
-    NSObject* value = dict[key];
172
-    if (value) {
173
-        bNumber = [value isKindOfClass:[NSNumber class]];
174
-    }
175
-    return bNumber;
176
-}
177
-
178
-- (CDVPluginResult *)getFileForURL:(CDVFilesystemURL *)baseURI requestedPath:(NSString *)requestedPath options:(NSDictionary *)options
179
-{
180
-    CDVPluginResult* result = nil;
181
-    BOOL bDirRequest = NO;
182
-    BOOL create = NO;
183
-    BOOL exclusive = NO;
184
-    int errorCode = 0;  // !!! risky - no error code currently defined for 0
185
-
186
-    if ([self valueForKeyIsNumber:options key:@"create"]) {
187
-        create = [(NSNumber*)[options valueForKey:@"create"] boolValue];
188
-    }
189
-    if ([self valueForKeyIsNumber:options key:@"exclusive"]) {
190
-        exclusive = [(NSNumber*)[options valueForKey:@"exclusive"] boolValue];
191
-    }
192
-    if ([self valueForKeyIsNumber:options key:@"getDir"]) {
193
-        // this will not exist for calls directly to getFile but will have been set by getDirectory before calling this method
194
-        bDirRequest = [(NSNumber*)[options valueForKey:@"getDir"] boolValue];
195
-    }
196
-    // see if the requested path has invalid characters - should we be checking for  more than just ":"?
197
-    if ([requestedPath rangeOfString:@":"].location != NSNotFound) {
198
-        errorCode = ENCODING_ERR;
199
-    } else {
200
-        // Build new fullPath for the requested resource.
201
-        // We concatenate the two paths together, and then scan the resulting string to remove
202
-        // parent ("..") references. Any parent references at the beginning of the string are
203
-        // silently removed.
204
-        NSString *combinedPath = [baseURI.fullPath stringByAppendingPathComponent:requestedPath];
205
-        combinedPath = [self normalizePath:combinedPath];
206
-        CDVFilesystemURL* requestedURL = [self URLforFullPath:combinedPath];
207
-
208
-        NSFileManager* fileMgr = [[NSFileManager alloc] init];
209
-        BOOL bIsDir;
210
-        BOOL bExists = [fileMgr fileExistsAtPath:[self filesystemPathForURL:requestedURL] isDirectory:&bIsDir];
211
-        if (bExists && (create == NO) && (bIsDir == !bDirRequest)) {
212
-            // path exists and is not of requested type  - return TYPE_MISMATCH_ERR
213
-            errorCode = TYPE_MISMATCH_ERR;
214
-        } else if (!bExists && (create == NO)) {
215
-            // path does not exist and create is false - return NOT_FOUND_ERR
216
-            errorCode = NOT_FOUND_ERR;
217
-        } else if (bExists && (create == YES) && (exclusive == YES)) {
218
-            // file/dir already exists and exclusive and create are both true - return PATH_EXISTS_ERR
219
-            errorCode = PATH_EXISTS_ERR;
220
-        } else {
221
-            // if bExists and create == YES - just return data
222
-            // if bExists and create == NO  - just return data
223
-            // if !bExists and create == YES - create and return data
224
-            BOOL bSuccess = YES;
225
-            NSError __autoreleasing* pError = nil;
226
-            if (!bExists && (create == YES)) {
227
-                if (bDirRequest) {
228
-                    // create the dir
229
-                    bSuccess = [fileMgr createDirectoryAtPath:[self filesystemPathForURL:requestedURL] withIntermediateDirectories:NO attributes:nil error:&pError];
230
-                } else {
231
-                    // create the empty file
232
-                    bSuccess = [fileMgr createFileAtPath:[self filesystemPathForURL:requestedURL] contents:nil attributes:nil];
233
-                }
234
-            }
235
-            if (!bSuccess) {
236
-                errorCode = ABORT_ERR;
237
-                if (pError) {
238
-                    NSLog(@"error creating directory: %@", [pError localizedDescription]);
239
-                }
240
-            } else {
241
-                // NSLog(@"newly created file/dir (%@) exists: %d", reqFullPath, [fileMgr fileExistsAtPath:reqFullPath]);
242
-                // file existed or was created
243
-                result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:[self makeEntryForPath:requestedURL.fullPath isDirectory:bDirRequest]];
244
-            }
245
-        } // are all possible conditions met?
246
-    }
247
-
248
-    if (errorCode > 0) {
249
-        // create error callback
250
-        result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:errorCode];
251
-    }
252
-    return result;
253
-
254
-}
255
-
256
-- (CDVPluginResult*)getParentForURL:(CDVFilesystemURL *)localURI
257
-{
258
-    CDVPluginResult* result = nil;
259
-    CDVFilesystemURL *newURI = nil;
260
-    if ([localURI.fullPath isEqualToString:@""]) {
261
-        // return self
262
-        newURI = localURI;
263
-    } else {
264
-        newURI = [CDVFilesystemURL fileSystemURLWithURL:[localURI.url URLByDeletingLastPathComponent]]; /* TODO: UGLY - FIX */
265
-    }
266
-    NSFileManager* fileMgr = [[NSFileManager alloc] init];
267
-    BOOL bIsDir;
268
-    BOOL bExists = [fileMgr fileExistsAtPath:[self filesystemPathForURL:newURI] isDirectory:&bIsDir];
269
-    if (bExists) {
270
-        result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:[self makeEntryForPath:newURI.fullPath isDirectory:bIsDir]];
271
-    } else {
272
-        // invalid path or file does not exist
273
-        result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:NOT_FOUND_ERR];
274
-    }
275
-    return result;
276
-}
277
-
278
-- (CDVPluginResult*)setMetadataForURL:(CDVFilesystemURL *)localURI withObject:(NSDictionary *)options
279
-{
280
-    BOOL ok = NO;
281
-
282
-    NSString* filePath = [self filesystemPathForURL:localURI];
283
-    // we only care about this iCloud key for now.
284
-    // set to 1/true to skip backup, set to 0/false to back it up (effectively removing the attribute)
285
-    NSString* iCloudBackupExtendedAttributeKey = @"com.apple.MobileBackup";
286
-    id iCloudBackupExtendedAttributeValue = [options objectForKey:iCloudBackupExtendedAttributeKey];
287
-
288
-    if ((iCloudBackupExtendedAttributeValue != nil) && [iCloudBackupExtendedAttributeValue isKindOfClass:[NSNumber class]]) {
289
-// todo: fix me
290
-//        if (IsAtLeastiOSVersion(@"5.1")) {
291
-//            NSURL* url = [NSURL fileURLWithPath:filePath];
292
-//            NSError* __autoreleasing error = nil;
293
-//
294
-//            ok = [url setResourceValue:[NSNumber numberWithBool:[iCloudBackupExtendedAttributeValue boolValue]] forKey:NSURLIsExcludedFromBackupKey error:&error];
295
-//        } else { // below 5.1 (deprecated - only really supported in 5.01)
296
-//            u_int8_t value = [iCloudBackupExtendedAttributeValue intValue];
297
-//            if (value == 0) { // remove the attribute (allow backup, the default)
298
-//                ok = (removexattr([filePath fileSystemRepresentation], [iCloudBackupExtendedAttributeKey cStringUsingEncoding:NSUTF8StringEncoding], 0) == 0);
299
-//            } else { // set the attribute (skip backup)
300
-//                ok = (setxattr([filePath fileSystemRepresentation], [iCloudBackupExtendedAttributeKey cStringUsingEncoding:NSUTF8StringEncoding], &value, sizeof(value), 0, 0) == 0);
301
-//            }
302
-//        }
303
-    }
304
-
305
-    if (ok) {
306
-        return [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
307
-    } else {
308
-        return [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR];
309
-    }
310
-}
311
-
312
-/* remove the file or directory (recursively)
313
- * IN:
314
- * NSString* fullPath - the full path to the file or directory to be removed
315
- * NSString* callbackId
316
- * called from remove and removeRecursively - check all pubic api specific error conditions (dir not empty, etc) before calling
317
- */
318
-
319
-- (CDVPluginResult*)doRemove:(NSString*)fullPath
320
-{
321
-    CDVPluginResult* result = nil;
322
-    BOOL bSuccess = NO;
323
-    NSError* __autoreleasing pError = nil;
324
-    NSFileManager* fileMgr = [[NSFileManager alloc] init];
325
-
326
-    @try {
327
-        bSuccess = [fileMgr removeItemAtPath:fullPath error:&pError];
328
-        if (bSuccess) {
329
-            result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
330
-        } else {
331
-            // see if we can give a useful error
332
-            CDVFileError errorCode = ABORT_ERR;
333
-            NSLog(@"error removing filesystem entry at %@: %@", fullPath, [pError localizedDescription]);
334
-            if ([pError code] == NSFileNoSuchFileError) {
335
-                errorCode = NOT_FOUND_ERR;
336
-            } else if ([pError code] == NSFileWriteNoPermissionError) {
337
-                errorCode = NO_MODIFICATION_ALLOWED_ERR;
338
-            }
339
-
340
-            result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:errorCode];
341
-        }
342
-    } @catch(NSException* e) {  // NSInvalidArgumentException if path is . or ..
343
-        result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsInt:SYNTAX_ERR];
344
-    }
345
-
346
-    return result;
347
-}
348
-
349
-- (CDVPluginResult *)removeFileAtURL:(CDVFilesystemURL *)localURI
350
-{
351
-    NSString *fileSystemPath = [self filesystemPathForURL:localURI];
352
-
353
-    NSFileManager* fileMgr = [[NSFileManager alloc] init];
354
-    BOOL bIsDir = NO;
355
-    BOOL bExists = [fileMgr fileExistsAtPath:fileSystemPath isDirectory:&bIsDir];
356
-    if (!bExists) {
357
-        return [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:NOT_FOUND_ERR];
358
-    }
359
-    if (bIsDir && ([[fileMgr contentsOfDirectoryAtPath:fileSystemPath error:nil] count] != 0)) {
360
-        // dir is not empty
361
-        return [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:INVALID_MODIFICATION_ERR];
362
-    }
363
-    return [self doRemove:fileSystemPath];
364
-}
365
-
366
-- (CDVPluginResult *)recursiveRemoveFileAtURL:(CDVFilesystemURL *)localURI
367
-{
368
-    NSString *fileSystemPath = [self filesystemPathForURL:localURI];
369
-    return [self doRemove:fileSystemPath];
370
-}
371
-
372
-/*
373
- * IN
374
- *  NSString localURI
375
- * OUT
376
- *  NSString full local filesystem path for the represented file or directory, or nil if no such path is possible
377
- *  The file or directory does not necessarily have to exist. nil is returned if the filesystem type is not recognized,
378
- *  or if the URL is malformed.
379
- * The incoming URI should be properly escaped (no raw spaces, etc. URI percent-encoding is expected).
380
- */
381
-- (NSString *)fullPathForFileSystemPath:(NSString *)fsPath
382
-{
383
-    if ([fsPath hasPrefix:self.fsRoot]) {
384
-        return [fsPath substringFromIndex:[self.fsRoot length]];
385
-    }
386
-    return nil;
387
-}
388
-
389
-
390
-- (CDVPluginResult *)readEntriesAtURL:(CDVFilesystemURL *)localURI
391
-{
392
-    NSFileManager* fileMgr = [[NSFileManager alloc] init];
393
-    NSError* __autoreleasing error = nil;
394
-    NSString *fileSystemPath = [self filesystemPathForURL:localURI];
395
-
396
-    NSArray* contents = [fileMgr contentsOfDirectoryAtPath:fileSystemPath error:&error];
397
-
398
-    if (contents) {
399
-        NSMutableArray* entries = [NSMutableArray arrayWithCapacity:1];
400
-        if ([contents count] > 0) {
401
-            // create an Entry (as JSON) for each file/dir
402
-            for (NSString* name in contents) {
403
-                // see if is dir or file
404
-                NSString* entryPath = [fileSystemPath stringByAppendingPathComponent:name];
405
-                BOOL bIsDir = NO;
406
-                [fileMgr fileExistsAtPath:entryPath isDirectory:&bIsDir];
407
-                NSDictionary* entryDict = [self makeEntryForPath:[self fullPathForFileSystemPath:entryPath] isDirectory:bIsDir];
408
-                [entries addObject:entryDict];
409
-            }
410
-        }
411
-        return [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsArray:entries];
412
-    } else {
413
-        // assume not found but could check error for more specific error conditions
414
-        return [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:NOT_FOUND_ERR];
415
-    }
416
-}
417
-
418
-- (unsigned long long)truncateFile:(NSString*)filePath atPosition:(unsigned long long)pos
419
-{
420
-    unsigned long long newPos = 0UL;
421
-
422
-    NSFileHandle* file = [NSFileHandle fileHandleForWritingAtPath:filePath];
423
-
424
-    if (file) {
425
-        [file truncateFileAtOffset:(unsigned long long)pos];
426
-        newPos = [file offsetInFile];
427
-        [file synchronizeFile];
428
-        [file closeFile];
429
-    }
430
-    return newPos;
431
-}
432
-
433
-- (CDVPluginResult *)truncateFileAtURL:(CDVFilesystemURL *)localURI atPosition:(unsigned long long)pos
434
-{
435
-    unsigned long long newPos = [self truncateFile:[self filesystemPathForURL:localURI] atPosition:pos];
436
-    return [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt:(int)newPos];
437
-}
438
-
439
-- (CDVPluginResult *)writeToFileAtURL:(CDVFilesystemURL *)localURL withData:(NSData*)encData append:(BOOL)shouldAppend
440
-{
441
-    NSString *filePath = [self filesystemPathForURL:localURL];
442
-
443
-    CDVPluginResult* result = nil;
444
-    CDVFileError errCode = INVALID_MODIFICATION_ERR;
445
-    int bytesWritten = 0;
446
-
447
-    if (filePath) {
448
-        NSOutputStream* fileStream = [NSOutputStream outputStreamToFileAtPath:filePath append:shouldAppend];
449
-        if (fileStream) {
450
-            NSUInteger len = [encData length];
451
-            if (len == 0) {
452
-                result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDouble:(double)len];
453
-            } else {
454
-                [fileStream open];
455
-
456
-                bytesWritten = (int)[fileStream write:[encData bytes] maxLength:len];
457
-
458
-                [fileStream close];
459
-                if (bytesWritten > 0) {
460
-                    result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt:bytesWritten];
461
-                    // } else {
462
-                    // can probably get more detailed error info via [fileStream streamError]
463
-                    // errCode already set to INVALID_MODIFICATION_ERR;
464
-                    // bytesWritten = 0; // may be set to -1 on error
465
-                }
466
-            }
467
-        } // else fileStream not created return INVALID_MODIFICATION_ERR
468
-    } else {
469
-        // invalid filePath
470
-        errCode = NOT_FOUND_ERR;
471
-    }
472
-    if (!result) {
473
-        // was an error
474
-        result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsInt:errCode];
475
-    }
476
-    return result;
477
-}
478
-
479
-/**
480
- * Helper function to check to see if the user attempted to copy an entry into its parent without changing its name,
481
- * or attempted to copy a directory into a directory that it contains directly or indirectly.
482
- *
483
- * IN:
484
- *  NSString* srcDir
485
- *  NSString* destinationDir
486
- * OUT:
487
- *  YES copy/ move is allows
488
- *  NO move is onto itself
489
- */
490
-- (BOOL)canCopyMoveSrc:(NSString*)src ToDestination:(NSString*)dest
491
-{
492
-    // This weird test is to determine if we are copying or moving a directory into itself.
493
-    // Copy /Documents/myDir to /Documents/myDir-backup is okay but
494
-    // Copy /Documents/myDir to /Documents/myDir/backup not okay
495
-    BOOL copyOK = YES;
496
-    NSRange range = [dest rangeOfString:src];
497
-
498
-    if (range.location != NSNotFound) {
499
-        NSRange testRange = {range.length - 1, ([dest length] - range.length)};
500
-        NSRange resultRange = [dest rangeOfString:@"/" options:0 range:testRange];
501
-        if (resultRange.location != NSNotFound) {
502
-            copyOK = NO;
503
-        }
504
-    }
505
-    return copyOK;
506
-}
507
-
508
-- (void)copyFileToURL:(CDVFilesystemURL *)destURL withName:(NSString *)newName fromFileSystem:(NSObject<CDVFileSystem> *)srcFs atURL:(CDVFilesystemURL *)srcURL copy:(BOOL)bCopy callback:(void (^)(CDVPluginResult *))callback
509
-{
510
-    NSFileManager *fileMgr = [[NSFileManager alloc] init];
511
-    NSString *destRootPath = [self filesystemPathForURL:destURL];
512
-    BOOL bDestIsDir = NO;
513
-    BOOL bDestExists = [fileMgr fileExistsAtPath:destRootPath isDirectory:&bDestIsDir];
514
-
515
-    NSString *newFileSystemPath = [destRootPath stringByAppendingPathComponent:newName];
516
-    NSString *newFullPath = [self fullPathForFileSystemPath:newFileSystemPath];
517
-
518
-    BOOL bNewIsDir = NO;
519
-    BOOL bNewExists = [fileMgr fileExistsAtPath:newFileSystemPath isDirectory:&bNewIsDir];
520
-
521
-    CDVPluginResult *result = nil;
522
-    int errCode = 0;
523
-
524
-    if (!bDestExists) {
525
-        // the destination root does not exist
526
-        errCode = NOT_FOUND_ERR;
527
-    }
528
-
529
-    else if ([srcFs isKindOfClass:[CDVLocalFilesystem class]]) {
530
-        /* Same FS, we can shortcut with NSFileManager operations */
531
-        NSString *srcFullPath = [srcFs filesystemPathForURL:srcURL];
532
-
533
-        BOOL bSrcIsDir = NO;
534
-        BOOL bSrcExists = [fileMgr fileExistsAtPath:srcFullPath isDirectory:&bSrcIsDir];
535
-
536
-        if (!bSrcExists) {
537
-            // the source does not exist
538
-            errCode = NOT_FOUND_ERR;
539
-        } else if ([newFileSystemPath isEqualToString:srcFullPath]) {
540
-            // source and destination can not be the same
541
-            errCode = INVALID_MODIFICATION_ERR;
542
-        } else if (bSrcIsDir && (bNewExists && !bNewIsDir)) {
543
-            // can't copy/move dir to file
544
-            errCode = INVALID_MODIFICATION_ERR;
545
-        } else { // no errors yet
546
-            NSError* __autoreleasing error = nil;
547
-            BOOL bSuccess = NO;
548
-            if (bCopy) {
549
-                if (bSrcIsDir && ![self canCopyMoveSrc:srcFullPath ToDestination:newFileSystemPath]) {
550
-                    // can't copy dir into self
551
-                    errCode = INVALID_MODIFICATION_ERR;
552
-                } else if (bNewExists) {
553
-                    // the full destination should NOT already exist if a copy
554
-                    errCode = PATH_EXISTS_ERR;
555
-                } else {
556
-                    bSuccess = [fileMgr copyItemAtPath:srcFullPath toPath:newFileSystemPath error:&error];
557
-                }
558
-            } else { // move
559
-                // iOS requires that destination must not exist before calling moveTo
560
-                // is W3C INVALID_MODIFICATION_ERR error if destination dir exists and has contents
561
-                //
562
-                if (!bSrcIsDir && (bNewExists && bNewIsDir)) {
563
-                    // can't move a file to directory
564
-                    errCode = INVALID_MODIFICATION_ERR;
565
-                } else if (bSrcIsDir && ![self canCopyMoveSrc:srcFullPath ToDestination:newFileSystemPath]) {
566
-                    // can't move a dir into itself
567
-                    errCode = INVALID_MODIFICATION_ERR;
568
-                } else if (bNewExists) {
569
-                    if (bNewIsDir && ([[fileMgr contentsOfDirectoryAtPath:newFileSystemPath error:NULL] count] != 0)) {
570
-                        // can't move dir to a dir that is not empty
571
-                        errCode = INVALID_MODIFICATION_ERR;
572
-                        newFileSystemPath = nil;  // so we won't try to move
573
-                    } else {
574
-                        // remove destination so can perform the moveItemAtPath
575
-                        bSuccess = [fileMgr removeItemAtPath:newFileSystemPath error:NULL];
576
-                        if (!bSuccess) {
577
-                            errCode = INVALID_MODIFICATION_ERR; // is this the correct error?
578
-                            newFileSystemPath = nil;
579
-                        }
580
-                    }
581
-                } else if (bNewIsDir && [newFileSystemPath hasPrefix:srcFullPath]) {
582
-                    // can't move a directory inside itself or to any child at any depth;
583
-                    errCode = INVALID_MODIFICATION_ERR;
584
-                    newFileSystemPath = nil;
585
-                }
586
-
587
-                if (newFileSystemPath != nil) {
588
-                    bSuccess = [fileMgr moveItemAtPath:srcFullPath toPath:newFileSystemPath error:&error];
589
-                }
590
-            }
591
-            if (bSuccess) {
592
-                // should verify it is there and of the correct type???
593
-                NSDictionary* newEntry = [self makeEntryForPath:newFullPath isDirectory:bSrcIsDir];
594
-                result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:newEntry];
595
-            } else {
596
-                if (error) {
597
-                    if (([error code] == NSFileReadUnknownError) || ([error code] == NSFileReadTooLargeError)) {
598
-                        errCode = NOT_READABLE_ERR;
599
-                    } else if ([error code] == NSFileWriteOutOfSpaceError) {
600
-                        errCode = QUOTA_EXCEEDED_ERR;
601
-                    } else if ([error code] == NSFileWriteNoPermissionError) {
602
-                        errCode = NO_MODIFICATION_ALLOWED_ERR;
603
-                    }
604
-                }
605
-            }
606
-        }
607
-    } else {
608
-        // Need to copy the hard way
609
-        [srcFs readFileAtURL:srcURL start:0 end:-1 callback:^(NSData* data, NSString* mimeType, CDVFileError errorCode) {
610
-            CDVPluginResult* result = nil;
611
-            if (data != nil) {
612
-                BOOL bSuccess = [data writeToFile:newFileSystemPath atomically:YES];
613
-                if (bSuccess) {
614
-                    // should verify it is there and of the correct type???
615
-                    NSDictionary* newEntry = [self makeEntryForPath:newFullPath isDirectory:NO];
616
-                    result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:newEntry];
617
-                } else {
618
-                    result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:ABORT_ERR];
619
-                }
620
-            } else {
621
-                result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:errorCode];
622
-            }
623
-            callback(result);
624
-        }];
625
-        return; // Async IO; return without callback.
626
-    }
627
-    if (result == nil) {
628
-        if (!errCode) {
629
-            errCode = INVALID_MODIFICATION_ERR; // Catch-all default
630
-        }
631
-        result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsInt:errCode];
632
-    }
633
-    callback(result);
634
-}
635
-
636
-/* helper function to get the mimeType from the file extension
637
- * IN:
638
- *	NSString* fullPath - filename (may include path)
639
- * OUT:
640
- *	NSString* the mime type as type/subtype.  nil if not able to determine
641
- */
642
-+ (NSString*)getMimeTypeFromPath:(NSString*)fullPath
643
-{
644
-    NSString* mimeType = nil;
645
-
646
-    if (fullPath) {
647
-        CFStringRef typeId = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (__bridge CFStringRef)[fullPath pathExtension], NULL);
648
-        if (typeId) {
649
-            mimeType = (__bridge_transfer NSString*)UTTypeCopyPreferredTagWithClass(typeId, kUTTagClassMIMEType);
650
-            if (!mimeType) {
651
-                // special case for m4a
652
-                if ([(__bridge NSString*)typeId rangeOfString : @"m4a-audio"].location != NSNotFound) {
653
-                    mimeType = @"audio/mp4";
654
-                } else if ([[fullPath pathExtension] rangeOfString:@"wav"].location != NSNotFound) {
655
-                    mimeType = @"audio/wav";
656
-                } else if ([[fullPath pathExtension] rangeOfString:@"css"].location != NSNotFound) {
657
-                    mimeType = @"text/css";
658
-                }
659
-            }
660
-            CFRelease(typeId);
661
-        }
662
-    }
663
-    return mimeType;
664
-}
665
-
666
-- (void)readFileAtURL:(CDVFilesystemURL *)localURL start:(NSInteger)start end:(NSInteger)end callback:(void (^)(NSData*, NSString* mimeType, CDVFileError))callback
667
-{
668
-    NSString *path = [self filesystemPathForURL:localURL];
669
-
670
-    NSString* mimeType = [CDVLocalFilesystem getMimeTypeFromPath:path];
671
-    if (mimeType == nil) {
672
-        mimeType = @"*/*";
673
-    }
674
-    NSFileHandle* file = [NSFileHandle fileHandleForReadingAtPath:path];
675
-    if (start > 0) {
676
-        [file seekToFileOffset:start];
677
-    }
678
-
679
-    NSData* readData;
680
-    if (end < 0) {
681
-        readData = [file readDataToEndOfFile];
682
-    } else {
683
-        readData = [file readDataOfLength:(end - start)];
684
-    }
685
-    [file closeFile];
686
-
687
-    callback(readData, mimeType, readData != nil ? NO_ERROR : NOT_FOUND_ERR);
688
-}
689
-
690
-- (void)getFileMetadataForURL:(CDVFilesystemURL *)localURL callback:(void (^)(CDVPluginResult *))callback
691
-{
692
-    NSString *path = [self filesystemPathForURL:localURL];
693
-    CDVPluginResult *result;
694
-    NSFileManager* fileMgr = [[NSFileManager alloc] init];
695
-
696
-    NSError* __autoreleasing error = nil;
697
-    NSDictionary* fileAttrs = [fileMgr attributesOfItemAtPath:path error:&error];
698
-
699
-    if (fileAttrs) {
700
-
701
-        // create dictionary of file info
702
-        NSMutableDictionary* fileInfo = [NSMutableDictionary dictionaryWithCapacity:5];
703
-
704
-        [fileInfo setObject:localURL.fullPath forKey:@"fullPath"];
705
-        [fileInfo setObject:@"" forKey:@"type"];  // can't easily get the mimetype unless create URL, send request and read response so skipping
706
-        [fileInfo setObject:[path lastPathComponent] forKey:@"name"];
707
-
708
-        // Ensure that directories (and other non-regular files) report size of 0
709
-        unsigned long long size = ([fileAttrs fileType] == NSFileTypeRegular ? [fileAttrs fileSize] : 0);
710
-        [fileInfo setObject:[NSNumber numberWithUnsignedLongLong:size] forKey:@"size"];
711
-
712
-        NSDate* modDate = [fileAttrs fileModificationDate];
713
-        if (modDate) {
714
-            [fileInfo setObject:[NSNumber numberWithDouble:[modDate timeIntervalSince1970] * 1000] forKey:@"lastModifiedDate"];
715
-        }
716
-
717
-        result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:fileInfo];
718
-
719
-    } else {
720
-        // didn't get fileAttribs
721
-        CDVFileError errorCode = ABORT_ERR;
722
-        NSLog(@"error getting metadata: %@", [error localizedDescription]);
723
-        if ([error code] == NSFileNoSuchFileError || [error code] == NSFileReadNoSuchFileError) {
724
-            errorCode = NOT_FOUND_ERR;
725
-        }
726
-        // log [NSNumber numberWithDouble: theMessage] objCtype to see what it returns
727
-        result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsInt:errorCode];
728
-    }
729
-
730
-    callback(result);
731
-}
732
-
733
-@end

+ 0
- 1190
node_modules/cordova-plugin-file/src/windows/FileProxy.js
Datei-Diff unterdrückt, da er zu groß ist
Datei anzeigen


+ 0
- 17
node_modules/cordova-plugin-file/tests/package.json Datei anzeigen

@@ -1,17 +0,0 @@
1
-{
2
-  "name": "cordova-plugin-file-tests",
3
-  "version": "6.0.2",
4
-  "description": "",
5
-  "cordova": {
6
-    "id": "cordova-plugin-file-tests",
7
-    "platforms": [
8
-      "android"
9
-    ]
10
-  },
11
-  "keywords": [
12
-    "ecosystem:cordova",
13
-    "cordova-android"
14
-  ],
15
-  "author": "",
16
-  "license": "Apache-2.0"
17
-}

+ 0
- 43
node_modules/cordova-plugin-file/tests/plugin.xml Datei anzeigen

@@ -1,43 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<!--
3
-  Licensed to the Apache Software Foundation (ASF) under one
4
-  or more contributor license agreements.  See the NOTICE file
5
-  distributed with this work for additional information
6
-  regarding copyright ownership.  The ASF licenses this file
7
-  to you under the Apache License, Version 2.0 (the
8
-  "License"); you may not use this file except in compliance
9
-  with the License.  You may obtain a copy of the License at
10
-
11
-    http://www.apache.org/licenses/LICENSE-2.0
12
-
13
-  Unless required by applicable law or agreed to in writing,
14
-  software distributed under the License is distributed on an
15
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
-  KIND, either express or implied.  See the License for the
17
-  specific language governing permissions and limitations
18
-  under the License.
19
--->
20
-
21
-<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
22
-    xmlns:android="http://schemas.android.com/apk/res/android"
23
-    id="cordova-plugin-file-tests"
24
-    version="6.0.2">
25
-
26
-    <name>Cordova File Plugin Tests</name>
27
-    <license>Apache 2.0</license>
28
-
29
-    <js-module src="tests.js" name="tests">
30
-    </js-module>
31
-
32
-    <platform name="android">
33
-        <source-file src="src/android/TestContentProvider.java" target-dir="src/org/apache/cordova/file/test" />
34
-        <config-file target="AndroidManifest.xml" parent="/*/application">
35
-            <provider
36
-                android:name="org.apache.cordova.file.test.TestContentProvider"
37
-                android:authorities="org.apache.cordova.file.testprovider"
38
-                android:exported="false" />
39
-        </config-file>
40
-        <asset src="www/fixtures/asset-test" target="fixtures/asset-test" />
41
-        <dependency id="cordova-plugin-contacts" />
42
-    </platform>
43
-</plugin>

+ 0
- 93
node_modules/cordova-plugin-file/tests/src/android/TestContentProvider.java Datei anzeigen

@@ -1,93 +0,0 @@
1
-/*
2
-       Licensed to the Apache Software Foundation (ASF) under one
3
-       or more contributor license agreements.  See the NOTICE file
4
-       distributed with this work for additional information
5
-       regarding copyright ownership.  The ASF licenses this file
6
-       to you under the Apache License, Version 2.0 (the
7
-       "License"); you may not use this file except in compliance
8
-       with the License.  You may obtain a copy of the License at
9
-
10
-         http://www.apache.org/licenses/LICENSE-2.0
11
-
12
-       Unless required by applicable law or agreed to in writing,
13
-       software distributed under the License is distributed on an
14
-       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
-       KIND, either express or implied.  See the License for the
16
-       specific language governing permissions and limitations
17
-       under the License.
18
- */
19
-package org.apache.cordova.file.test;
20
-
21
-import android.content.ContentProvider;
22
-import android.net.Uri;
23
-import android.content.res.AssetFileDescriptor;
24
-import android.content.res.AssetManager;
25
-
26
-import java.io.File;
27
-import java.io.FileInputStream;
28
-import java.io.FileNotFoundException;
29
-import android.content.ContentValues;
30
-import android.database.Cursor;
31
-import android.os.ParcelFileDescriptor;
32
-
33
-import org.apache.cordova.CordovaResourceApi;
34
-
35
-import java.io.IOException;
36
-import java.util.HashMap;
37
-
38
-public class TestContentProvider extends ContentProvider {
39
-
40
-    @Override
41
-    public ParcelFileDescriptor openFile(Uri uri, String mode) throws FileNotFoundException {
42
-        String fileName = uri.getQueryParameter("realPath");
43
-        if (fileName == null) {
44
-            fileName = uri.getPath();
45
-        }
46
-        if (fileName == null || fileName.length() < 1) {
47
-            throw new FileNotFoundException();
48
-        }
49
-        CordovaResourceApi resourceApi = new CordovaResourceApi(getContext(), null);
50
-        try {
51
-            File f = File.createTempFile("test-content-provider", ".tmp");
52
-            resourceApi.copyResource(Uri.parse("file:///android_asset" + fileName), Uri.fromFile(f));
53
-            return ParcelFileDescriptor.open(f, ParcelFileDescriptor.MODE_READ_ONLY);
54
-        } catch (FileNotFoundException e) {
55
-            throw e;
56
-        } catch (IOException e) {
57
-            e.printStackTrace();
58
-            throw new FileNotFoundException("IO error: " + e.toString());
59
-        }
60
-    }
61
-
62
-    @Override
63
-    public boolean onCreate() {
64
-        return false;
65
-    }
66
-
67
-    @Override
68
-    public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
69
-        throw new UnsupportedOperationException();
70
-    }
71
-
72
-    @Override
73
-    public String getType(Uri uri) {
74
-        return "text/html";
75
-    }
76
-
77
-    @Override
78
-    public Uri insert(Uri uri, ContentValues values) {
79
-        throw new UnsupportedOperationException();
80
-    }
81
-
82
-    @Override
83
-    public int delete(Uri uri, String selection, String[] selectionArgs) {
84
-        throw new UnsupportedOperationException();
85
-    }
86
-
87
-    @Override
88
-    public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {
89
-        throw new UnsupportedOperationException();
90
-    }
91
-
92
-
93
-}

+ 0
- 4163
node_modules/cordova-plugin-file/tests/tests.js
Datei-Diff unterdrückt, da er zu groß ist
Datei anzeigen


+ 0
- 1
node_modules/cordova-plugin-file/tests/www/fixtures/asset-test/asset-test.txt Datei anzeigen

@@ -1 +0,0 @@
1
-This file is here for testing purposes

+ 0
- 378
node_modules/cordova-plugin-file/types/index.d.ts Datei anzeigen

@@ -1,378 +0,0 @@
1
-// Type definitions for Apache Cordova File System plugin
2
-// Project: https://github.com/apache/cordova-plugin-file
3
-// Definitions by: Microsoft Open Technologies Inc <http://msopentech.com>
4
-// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5
-//
6
-// Copyright (c) Microsoft Open Technologies, Inc.
7
-// Licensed under the MIT license.
8
-
9
-interface Window {
10
-    /**
11
-     * Requests a filesystem in which to store application data.
12
-     * @param type              Whether the filesystem requested should be persistent, as defined above. Use one of TEMPORARY or PERSISTENT.
13
-     * @param size              This is an indicator of how much storage space, in bytes, the application expects to need.
14
-     * @param successCallback   The callback that is called when the user agent provides a filesystem.
15
-     * @param errorCallback     A callback that is called when errors happen, or when the request to obtain the filesystem is denied.
16
-     */
17
-    requestFileSystem(
18
-        type: LocalFileSystem,
19
-        size: number,
20
-        successCallback: (fileSystem: FileSystem) => void,
21
-        errorCallback?: (fileError: FileError) => void): void;
22
-    /**
23
-     * Look up file system Entry referred to by local URL.
24
-     * @param string url       URL referring to a local file or directory
25
-     * @param successCallback  invoked with Entry object corresponding to URL
26
-     * @param errorCallback    invoked if error occurs retrieving file system entry
27
-     */
28
-    resolveLocalFileSystemURL(url: string,
29
-        successCallback: (entry: Entry) => void,
30
-        errorCallback?: (error: FileError) => void): void;
31
-    /**
32
-     * Look up file system Entry referred to by local URI.
33
-     * @param string uri       URI referring to a local file or directory
34
-     * @param successCallback  invoked with Entry object corresponding to URI
35
-     * @param errorCallback    invoked if error occurs retrieving file system entry
36
-     */
37
-    resolveLocalFileSystemURI(uri: string,
38
-        successCallback: (entry: Entry) => void,
39
-        errorCallback?: (error: FileError) => void): void;
40
-    TEMPORARY: number;
41
-    PERSISTENT: number;
42
-}
43
-
44
-/** This interface represents a file system. */
45
-interface FileSystem {
46
-    /* The name of the file system, unique across the list of exposed file systems. */
47
-    name: string;
48
-    /** The root directory of the file system. */
49
-    root: DirectoryEntry;
50
-}
51
-
52
-/**
53
- * An abstract interface representing entries in a file system,
54
- * each of which may be a File or DirectoryEntry.
55
- */
56
-interface Entry {
57
-    /** Entry is a file. */
58
-    isFile: boolean;
59
-    /** Entry is a directory. */
60
-    isDirectory: boolean;
61
-    /** The name of the entry, excluding the path leading to it. */
62
-    name: string;
63
-    /** The full absolute path from the root to the entry. */
64
-    fullPath: string;
65
-    /** The file system on which the entry resides. */
66
-    filesystem: FileSystem;
67
-    nativeURL: string;
68
-    /**
69
-     * Look up metadata about this entry.
70
-     * @param successCallback A callback that is called with the time of the last modification.
71
-     * @param errorCallback   A callback that is called when errors happen.
72
-     */
73
-    getMetadata(
74
-        successCallback: (metadata: Metadata) => void,
75
-        errorCallback?: (error: FileError) => void): void;
76
-    /**
77
-     * Move an entry to a different location on the file system. It is an error to try to:
78
-     *     move a directory inside itself or to any child at any depth;move an entry into its parent if a name different from its current one isn't provided;
79
-     *     move a file to a path occupied by a directory;
80
-     *     move a directory to a path occupied by a file;
81
-     *     move any element to a path occupied by a directory which is not empty.
82
-     * A move of a file on top of an existing file must attempt to delete and replace that file.
83
-     * A move of a directory on top of an existing empty directory must attempt to delete and replace that directory.
84
-     * @param parent  The directory to which to move the entry.
85
-     * @param newName The new name of the entry. Defaults to the Entry's current name if unspecified.
86
-     * @param successCallback A callback that is called with the Entry for the new location.
87
-     * @param errorCallback   A callback that is called when errors happen.
88
-     */
89
-    moveTo(parent: DirectoryEntry,
90
-        newName?: string,
91
-        successCallback?: (entry: Entry) => void,
92
-        errorCallback?: (error: FileError) => void): void;
93
-    /**
94
-     * Copy an entry to a different location on the file system. It is an error to try to:
95
-     *     copy a directory inside itself or to any child at any depth;
96
-     *     copy an entry into its parent if a name different from its current one isn't provided;
97
-     *     copy a file to a path occupied by a directory;
98
-     *     copy a directory to a path occupied by a file;
99
-     *     copy any element to a path occupied by a directory which is not empty.
100
-     *     A copy of a file on top of an existing file must attempt to delete and replace that file.
101
-     *     A copy of a directory on top of an existing empty directory must attempt to delete and replace that directory.
102
-     * Directory copies are always recursive--that is, they copy all contents of the directory.
103
-     * @param parent The directory to which to move the entry.
104
-     * @param newName The new name of the entry. Defaults to the Entry's current name if unspecified.
105
-     * @param successCallback A callback that is called with the Entry for the new object.
106
-     * @param errorCallback A callback that is called when errors happen.
107
-     */
108
-    copyTo(parent: DirectoryEntry,
109
-        newName?: string,
110
-        successCallback?: (entry: Entry) => void,
111
-        errorCallback?: (error: FileError) => void): void;
112
-    /**
113
-     * Returns a URL that can be used as the src attribute of a <video> or <audio> tag.
114
-     * If that is not possible, construct a cdvfile:// URL.
115
-     * @return string URL
116
-     */
117
-    toURL(): string;
118
-    /**
119
-     * Return a URL that can be passed across the bridge to identify this entry.
120
-     * @return string URL that can be passed across the bridge to identify this entry
121
-     */
122
-    toInternalURL(): string;
123
-    /**
124
-     * Deletes a file or directory. It is an error to attempt to delete a directory that is not empty. It is an error to attempt to delete the root directory of a filesystem.
125
-     * @param successCallback A callback that is called on success.
126
-     * @param errorCallback   A callback that is called when errors happen.
127
-     */
128
-    remove(successCallback: () => void,
129
-        errorCallback?: (error: FileError) => void): void;
130
-    /**
131
-     * Look up the parent DirectoryEntry containing this Entry. If this Entry is the root of its filesystem, its parent is itself.
132
-     * @param successCallback A callback that is called with the time of the last modification.
133
-     * @param errorCallback   A callback that is called when errors happen.
134
-     */
135
-    getParent(successCallback: (entry: Entry) => void,
136
-        errorCallback?: (error: FileError) => void): void;
137
-}
138
-
139
-/** This interface supplies information about the state of a file or directory. */
140
-interface Metadata {
141
-    /** This is the time at which the file or directory was last modified. */
142
-    modificationTime: Date;
143
-    /** The size of the file, in bytes. This must return 0 for directories. */
144
-    size: number;
145
-}
146
-
147
-/** This interface represents a directory on a file system. */
148
-interface DirectoryEntry extends Entry {
149
-    /**
150
-     * Creates a new DirectoryReader to read Entries from this Directory.
151
-     */
152
-    createReader(): DirectoryReader;
153
-    /**
154
-     * Creates or looks up a file.
155
-     * @param path    Either an absolute path or a relative path from this DirectoryEntry
156
-     *                to the file to be looked up or created.
157
-     *                It is an error to attempt to create a file whose immediate parent does not yet exist.
158
-     * @param options If create and exclusive are both true, and the path already exists, getFile must fail.
159
-     *                If create is true, the path doesn't exist, and no other error occurs, getFile must create it as a zero-length file and return a corresponding FileEntry.
160
-     *                If create is not true and the path doesn't exist, getFile must fail.
161
-     *                If create is not true and the path exists, but is a directory, getFile must fail.
162
-     *                Otherwise, if no other error occurs, getFile must return a FileEntry corresponding to path.
163
-     * @param successCallback A callback that is called to return the File selected or created.
164
-     * @param errorCallback   A callback that is called when errors happen.
165
-     */
166
-    getFile(path: string, options?: Flags,
167
-        successCallback?: (entry: FileEntry) => void,
168
-        errorCallback?: (error: FileError) => void): void;
169
-    /**
170
-     * Creates or looks up a directory.
171
-     * @param path    Either an absolute path or a relative path from this DirectoryEntry
172
-     *                to the directory to be looked up or created.
173
-     *                It is an error to attempt to create a directory whose immediate parent does not yet exist.
174
-     * @param options If create and exclusive are both true and the path already exists, getDirectory must fail.
175
-     *                If create is true, the path doesn't exist, and no other error occurs, getDirectory must create and return a corresponding DirectoryEntry.
176
-     *                If create is not true and the path doesn't exist, getDirectory must fail.
177
-     *                If create is not true and the path exists, but is a file, getDirectory must fail.
178
-     *                Otherwise, if no other error occurs, getDirectory must return a DirectoryEntry corresponding to path.
179
-     * @param successCallback A callback that is called to return the Directory selected or created.
180
-     * @param errorCallback   A callback that is called when errors happen.
181
-     */
182
-    getDirectory(path: string, options?: Flags,
183
-        successCallback?: (entry: DirectoryEntry) => void,
184
-        errorCallback?: (error: FileError) => void): void;
185
-    /**
186
-     * Deletes a directory and all of its contents, if any. In the event of an error (e.g. trying
187
-     * to delete a directory that contains a file that cannot be removed), some of the contents
188
-     * of the directory may be deleted. It is an error to attempt to delete the root directory of a filesystem.
189
-     * @param successCallback A callback that is called on success.
190
-     * @param errorCallback   A callback that is called when errors happen.
191
-     */
192
-    removeRecursively(successCallback: () => void,
193
-        errorCallback?: (error: FileError) => void): void;
194
-}
195
-
196
-/**
197
- * This dictionary is used to supply arguments to methods
198
- * that look up or create files or directories.
199
- */
200
-interface Flags {
201
-    /** Used to indicate that the user wants to create a file or directory if it was not previously there. */
202
-    create?: boolean;
203
-    /** By itself, exclusive must have no effect. Used with create, it must cause getFile and getDirectory to fail if the target path already exists. */
204
-    exclusive?: boolean;
205
-}
206
-
207
-/**
208
- * This interface lets a user list files and directories in a directory. If there are
209
- * no additions to or deletions from a directory between the first and last call to
210
- * readEntries, and no errors occur, then:
211
- *     A series of calls to readEntries must return each entry in the directory exactly once.
212
- *     Once all entries have been returned, the next call to readEntries must produce an empty array.
213
- *     If not all entries have been returned, the array produced by readEntries must not be empty.
214
- *     The entries produced by readEntries must not include the directory itself ["."] or its parent [".."].
215
- */
216
-interface DirectoryReader {
217
-    /**
218
-     * Read the next block of entries from this directory.
219
-     * @param successCallback Called once per successful call to readEntries to deliver the next
220
-     *                        previously-unreported set of Entries in the associated Directory.
221
-     *                        If all Entries have already been returned from previous invocations
222
-     *                        of readEntries, successCallback must be called with a zero-length array as an argument.
223
-     * @param errorCallback   A callback indicating that there was an error reading from the Directory.
224
-     */
225
-    readEntries(
226
-        successCallback: (entries: Entry[]) => void,
227
-        errorCallback?: (error: FileError) => void): void;
228
-}
229
-
230
-/** This interface represents a file on a file system. */
231
-interface FileEntry extends Entry {
232
-    /**
233
-     * Creates a new FileWriter associated with the file that this FileEntry represents.
234
-     * @param successCallback A callback that is called with the new FileWriter.
235
-     * @param errorCallback   A callback that is called when errors happen.
236
-     */
237
-    createWriter(successCallback: (
238
-        writer: FileWriter) => void,
239
-        errorCallback?: (error: FileError) => void): void;
240
-    /**
241
-     * Returns a File that represents the current state of the file that this FileEntry represents.
242
-     * @param successCallback A callback that is called with the File.
243
-     * @param errorCallback   A callback that is called when errors happen.
244
-     */
245
-    file(successCallback: (file: File) => void,
246
-        errorCallback?: (error: FileError) => void): void;
247
-}
248
-
249
-/**
250
- * This interface provides methods to monitor the asynchronous writing of blobs
251
- * to disk using progress events and event handler attributes.
252
- */
253
-interface FileSaver extends EventTarget {
254
-    /** Terminate file operation */
255
-    abort(): void;
256
-    /**
257
-     * The FileSaver object can be in one of 3 states. The readyState attribute, on getting,
258
-     * must return the current state, which must be one of the following values:
259
-     *     INIT
260
-     *     WRITING
261
-     *     DONE
262
-     */
263
-    readyState: number;
264
-    /** Handler for writestart events. */
265
-    onwritestart: (event: ProgressEvent) => void;
266
-    /** Handler for progress events. */
267
-    onprogress: (event: ProgressEvent) => void;
268
-    /** Handler for write events. */
269
-    onwrite: (event: ProgressEvent) => void;
270
-    /** Handler for abort events. */
271
-    onabort: (event: ProgressEvent) => void;
272
-    /** Handler for error events. */
273
-    onerror: (event: ProgressEvent) => void;
274
-    /** Handler for writeend events. */
275
-    onwriteend: (event: ProgressEvent) => void;
276
-    /** The last error that occurred on the FileSaver. */
277
-    error: Error;
278
-}
279
-
280
-/**
281
- * This interface expands on the FileSaver interface to allow for multiple write
282
- * actions, rather than just saving a single Blob.
283
- */
284
-interface FileWriter extends FileSaver {
285
-    /**
286
-     * The byte offset at which the next write to the file will occur. This always less or equal than length.
287
-     * A newly-created FileWriter will have position set to 0.
288
-     */
289
-    position: number;
290
-    /**
291
-     * The length of the file. If the user does not have read access to the file,
292
-     * this will be the highest byte offset at which the user has written.
293
-     */
294
-    length: number;
295
-    /**
296
-     * Write the supplied data to the file at position.
297
-     * @param {Blob|string} data The blob to write.
298
-     */
299
-    write(data: Blob|string): void;
300
-    /**
301
-     * The file position at which the next write will occur.
302
-     * @param offset If nonnegative, an absolute byte offset into the file.
303
-     *               If negative, an offset back from the end of the file.
304
-     */
305
-    seek(offset: number): void;
306
-    /**
307
-     * Changes the length of the file to that specified. If shortening the file, data beyond the new length
308
-     * will be discarded. If extending the file, the existing data will be zero-padded up to the new length.
309
-     * @param size The size to which the length of the file is to be adjusted, measured in bytes.
310
-     */
311
-    truncate(size: number): void;
312
-}
313
-
314
-/* FileWriter states */
315
-declare var FileWriter: {
316
-    INIT: number;
317
-    WRITING: number;
318
-    DONE: number
319
-};
320
-
321
-interface FileError {
322
-    /** Error code */
323
-    code: number;
324
-}
325
-
326
-declare var FileError: {
327
-    new (code: number): FileError;
328
-    NOT_FOUND_ERR: number;
329
-    SECURITY_ERR: number;
330
-    ABORT_ERR: number;
331
-    NOT_READABLE_ERR: number;
332
-    ENCODING_ERR: number;
333
-    NO_MODIFICATION_ALLOWED_ERR: number;
334
-    INVALID_STATE_ERR: number;
335
-    SYNTAX_ERR: number;
336
-    INVALID_MODIFICATION_ERR: number;
337
-    QUOTA_EXCEEDED_ERR: number;
338
-    TYPE_MISMATCH_ERR: number;
339
-    PATH_EXISTS_ERR: number;
340
-};
341
-
342
-/*
343
- * Constants defined in fileSystemPaths
344
- */
345
-interface Cordova {
346
-    file: {
347
-        /* Read-only directory where the application is installed. */
348
-        applicationDirectory: string;
349
-        /* Root of app's private writable storage */
350
-        applicationStorageDirectory: string;
351
-        /* Where to put app-specific data files. */
352
-        dataDirectory: string;
353
-        /* Cached files that should survive app restarts. Apps should not rely on the OS to delete files in here. */
354
-        cacheDirectory: string;
355
-        /* Android: the application space on external storage. */
356
-        externalApplicationStorageDirectory: string;
357
-        /* Android: Where to put app-specific data files on external storage. */
358
-        externalDataDirectory: string;
359
-        /* Android: the application cache on external storage. */
360
-        externalCacheDirectory: string;
361
-        /* Android: the external storage (SD card) root. */
362
-        externalRootDirectory: string;
363
-        /* iOS: Temp directory that the OS can clear at will. */
364
-        tempDirectory: string;
365
-        /* iOS: Holds app-specific files that should be synced (e.g. to iCloud). */
366
-        syncedDataDirectory: string;
367
-        /* iOS: Files private to the app, but that are meaningful to other applciations (e.g. Office files) */
368
-        documentsDirectory: string;
369
-        /* BlackBerry10: Files globally available to all apps */
370
-        sharedDirectory: string
371
-    }
372
-}
373
-
374
-
375
-declare enum LocalFileSystem {
376
-    PERSISTENT=1,
377
-    TEMPORARY=0
378
-}

+ 0
- 117
node_modules/cordova-plugin-file/www/DirectoryEntry.js Datei anzeigen

@@ -1,117 +0,0 @@
1
-/*
2
- *
3
- * Licensed to the Apache Software Foundation (ASF) under one
4
- * or more contributor license agreements.  See the NOTICE file
5
- * distributed with this work for additional information
6
- * regarding copyright ownership.  The ASF licenses this file
7
- * to you under the Apache License, Version 2.0 (the
8
- * "License"); you may not use this file except in compliance
9
- * with the License.  You may obtain a copy of the License at
10
- *
11
- *   http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing,
14
- * software distributed under the License is distributed on an
15
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
- * KIND, either express or implied.  See the License for the
17
- * specific language governing permissions and limitations
18
- * under the License.
19
- *
20
-*/
21
-
22
-var argscheck = require('cordova/argscheck');
23
-var utils = require('cordova/utils');
24
-var exec = require('cordova/exec');
25
-var Entry = require('./Entry');
26
-var FileError = require('./FileError');
27
-var DirectoryReader = require('./DirectoryReader');
28
-
29
-/**
30
- * An interface representing a directory on the file system.
31
- *
32
- * {boolean} isFile always false (readonly)
33
- * {boolean} isDirectory always true (readonly)
34
- * {DOMString} name of the directory, excluding the path leading to it (readonly)
35
- * {DOMString} fullPath the absolute full path to the directory (readonly)
36
- * {FileSystem} filesystem on which the directory resides (readonly)
37
- */
38
-var DirectoryEntry = function (name, fullPath, fileSystem, nativeURL) {
39
-
40
-    // add trailing slash if it is missing
41
-    if ((fullPath) && !/\/$/.test(fullPath)) {
42
-        fullPath += '/';
43
-    }
44
-    // add trailing slash if it is missing
45
-    if (nativeURL && !/\/$/.test(nativeURL)) {
46
-        nativeURL += '/';
47
-    }
48
-    DirectoryEntry.__super__.constructor.call(this, false, true, name, fullPath, fileSystem, nativeURL);
49
-};
50
-
51
-utils.extend(DirectoryEntry, Entry);
52
-
53
-/**
54
- * Creates a new DirectoryReader to read entries from this directory
55
- */
56
-DirectoryEntry.prototype.createReader = function () {
57
-    return new DirectoryReader(this.toInternalURL());
58
-};
59
-
60
-/**
61
- * Creates or looks up a directory
62
- *
63
- * @param {DOMString} path either a relative or absolute path from this directory in which to look up or create a directory
64
- * @param {Flags} options to create or exclusively create the directory
65
- * @param {Function} successCallback is called with the new entry
66
- * @param {Function} errorCallback is called with a FileError
67
- */
68
-DirectoryEntry.prototype.getDirectory = function (path, options, successCallback, errorCallback) {
69
-    argscheck.checkArgs('sOFF', 'DirectoryEntry.getDirectory', arguments);
70
-    var fs = this.filesystem;
71
-    var win = successCallback && function (result) {
72
-        var entry = new DirectoryEntry(result.name, result.fullPath, fs, result.nativeURL);
73
-        successCallback(entry);
74
-    };
75
-    var fail = errorCallback && function (code) {
76
-        errorCallback(new FileError(code));
77
-    };
78
-    exec(win, fail, 'File', 'getDirectory', [this.toInternalURL(), path, options]);
79
-};
80
-
81
-/**
82
- * Deletes a directory and all of it's contents
83
- *
84
- * @param {Function} successCallback is called with no parameters
85
- * @param {Function} errorCallback is called with a FileError
86
- */
87
-DirectoryEntry.prototype.removeRecursively = function (successCallback, errorCallback) {
88
-    argscheck.checkArgs('FF', 'DirectoryEntry.removeRecursively', arguments);
89
-    var fail = errorCallback && function (code) {
90
-        errorCallback(new FileError(code));
91
-    };
92
-    exec(successCallback, fail, 'File', 'removeRecursively', [this.toInternalURL()]);
93
-};
94
-
95
-/**
96
- * Creates or looks up a file
97
- *
98
- * @param {DOMString} path either a relative or absolute path from this directory in which to look up or create a file
99
- * @param {Flags} options to create or exclusively create the file
100
- * @param {Function} successCallback is called with the new entry
101
- * @param {Function} errorCallback is called with a FileError
102
- */
103
-DirectoryEntry.prototype.getFile = function (path, options, successCallback, errorCallback) {
104
-    argscheck.checkArgs('sOFF', 'DirectoryEntry.getFile', arguments);
105
-    var fs = this.filesystem;
106
-    var win = successCallback && function (result) {
107
-        var FileEntry = require('./FileEntry');
108
-        var entry = new FileEntry(result.name, result.fullPath, fs, result.nativeURL);
109
-        successCallback(entry);
110
-    };
111
-    var fail = errorCallback && function (code) {
112
-        errorCallback(new FileError(code));
113
-    };
114
-    exec(win, fail, 'File', 'getFile', [this.toInternalURL(), path, options]);
115
-};
116
-
117
-module.exports = DirectoryEntry;

+ 0
- 72
node_modules/cordova-plugin-file/www/DirectoryReader.js Datei anzeigen

@@ -1,72 +0,0 @@
1
-/*
2
- *
3
- * Licensed to the Apache Software Foundation (ASF) under one
4
- * or more contributor license agreements.  See the NOTICE file
5
- * distributed with this work for additional information
6
- * regarding copyright ownership.  The ASF licenses this file
7
- * to you under the Apache License, Version 2.0 (the
8
- * "License"); you may not use this file except in compliance
9
- * with the License.  You may obtain a copy of the License at
10
- *
11
- *   http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing,
14
- * software distributed under the License is distributed on an
15
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
- * KIND, either express or implied.  See the License for the
17
- * specific language governing permissions and limitations
18
- * under the License.
19
- *
20
-*/
21
-
22
-var exec = require('cordova/exec');
23
-var FileError = require('./FileError');
24
-
25
-/**
26
- * An interface that lists the files and directories in a directory.
27
- */
28
-function DirectoryReader (localURL) {
29
-    this.localURL = localURL || null;
30
-    this.hasReadEntries = false;
31
-}
32
-
33
-/**
34
- * Returns a list of entries from a directory.
35
- *
36
- * @param {Function} successCallback is called with a list of entries
37
- * @param {Function} errorCallback is called with a FileError
38
- */
39
-DirectoryReader.prototype.readEntries = function (successCallback, errorCallback) {
40
-    // If we've already read and passed on this directory's entries, return an empty list.
41
-    if (this.hasReadEntries) {
42
-        successCallback([]);
43
-        return;
44
-    }
45
-    var reader = this;
46
-    var win = typeof successCallback !== 'function' ? null : function (result) {
47
-        var retVal = [];
48
-        for (var i = 0; i < result.length; i++) {
49
-            var entry = null;
50
-            if (result[i].isDirectory) {
51
-                entry = new (require('./DirectoryEntry'))();
52
-            } else if (result[i].isFile) {
53
-                entry = new (require('./FileEntry'))();
54
-            }
55
-            entry.isDirectory = result[i].isDirectory;
56
-            entry.isFile = result[i].isFile;
57
-            entry.name = result[i].name;
58
-            entry.fullPath = result[i].fullPath;
59
-            entry.filesystem = new (require('./FileSystem'))(result[i].filesystemName);
60
-            entry.nativeURL = result[i].nativeURL;
61
-            retVal.push(entry);
62
-        }
63
-        reader.hasReadEntries = true;
64
-        successCallback(retVal);
65
-    };
66
-    var fail = typeof errorCallback !== 'function' ? null : function (code) {
67
-        errorCallback(new FileError(code));
68
-    };
69
-    exec(win, fail, 'File', 'readEntries', [this.localURL]);
70
-};
71
-
72
-module.exports = DirectoryReader;

+ 0
- 260
node_modules/cordova-plugin-file/www/Entry.js Datei anzeigen

@@ -1,260 +0,0 @@
1
-/*
2
- *
3
- * Licensed to the Apache Software Foundation (ASF) under one
4
- * or more contributor license agreements.  See the NOTICE file
5
- * distributed with this work for additional information
6
- * regarding copyright ownership.  The ASF licenses this file
7
- * to you under the Apache License, Version 2.0 (the
8
- * "License"); you may not use this file except in compliance
9
- * with the License.  You may obtain a copy of the License at
10
- *
11
- *   http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing,
14
- * software distributed under the License is distributed on an
15
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
- * KIND, either express or implied.  See the License for the
17
- * specific language governing permissions and limitations
18
- * under the License.
19
- *
20
-*/
21
-
22
-var argscheck = require('cordova/argscheck');
23
-var exec = require('cordova/exec');
24
-var FileError = require('./FileError');
25
-var Metadata = require('./Metadata');
26
-
27
-/**
28
- * Represents a file or directory on the local file system.
29
- *
30
- * @param isFile
31
- *            {boolean} true if Entry is a file (readonly)
32
- * @param isDirectory
33
- *            {boolean} true if Entry is a directory (readonly)
34
- * @param name
35
- *            {DOMString} name of the file or directory, excluding the path
36
- *            leading to it (readonly)
37
- * @param fullPath
38
- *            {DOMString} the absolute full path to the file or directory
39
- *            (readonly)
40
- * @param fileSystem
41
- *            {FileSystem} the filesystem on which this entry resides
42
- *            (readonly)
43
- * @param nativeURL
44
- *            {DOMString} an alternate URL which can be used by native
45
- *            webview controls, for example media players.
46
- *            (optional, readonly)
47
- */
48
-function Entry (isFile, isDirectory, name, fullPath, fileSystem, nativeURL) {
49
-    this.isFile = !!isFile;
50
-    this.isDirectory = !!isDirectory;
51
-    this.name = name || '';
52
-    this.fullPath = fullPath || '';
53
-    this.filesystem = fileSystem || null;
54
-    this.nativeURL = nativeURL || null;
55
-}
56
-
57
-/**
58
- * Look up the metadata of the entry.
59
- *
60
- * @param successCallback
61
- *            {Function} is called with a Metadata object
62
- * @param errorCallback
63
- *            {Function} is called with a FileError
64
- */
65
-Entry.prototype.getMetadata = function (successCallback, errorCallback) {
66
-    argscheck.checkArgs('FF', 'Entry.getMetadata', arguments);
67
-    var success = successCallback && function (entryMetadata) {
68
-        var metadata = new Metadata({
69
-            size: entryMetadata.size,
70
-            modificationTime: entryMetadata.lastModifiedDate
71
-        });
72
-        successCallback(metadata);
73
-    };
74
-    var fail = errorCallback && function (code) {
75
-        errorCallback(new FileError(code));
76
-    };
77
-    exec(success, fail, 'File', 'getFileMetadata', [this.toInternalURL()]);
78
-};
79
-
80
-/**
81
- * Set the metadata of the entry.
82
- *
83
- * @param successCallback
84
- *            {Function} is called with a Metadata object
85
- * @param errorCallback
86
- *            {Function} is called with a FileError
87
- * @param metadataObject
88
- *            {Object} keys and values to set
89
- */
90
-Entry.prototype.setMetadata = function (successCallback, errorCallback, metadataObject) {
91
-    argscheck.checkArgs('FFO', 'Entry.setMetadata', arguments);
92
-    exec(successCallback, errorCallback, 'File', 'setMetadata', [this.toInternalURL(), metadataObject]);
93
-};
94
-
95
-/**
96
- * Move a file or directory to a new location.
97
- *
98
- * @param parent
99
- *            {DirectoryEntry} the directory to which to move this entry
100
- * @param newName
101
- *            {DOMString} new name of the entry, defaults to the current name
102
- * @param successCallback
103
- *            {Function} called with the new DirectoryEntry object
104
- * @param errorCallback
105
- *            {Function} called with a FileError
106
- */
107
-Entry.prototype.moveTo = function (parent, newName, successCallback, errorCallback) {
108
-    argscheck.checkArgs('oSFF', 'Entry.moveTo', arguments);
109
-    var fail = errorCallback && function (code) {
110
-        errorCallback(new FileError(code));
111
-    };
112
-    var srcURL = this.toInternalURL();
113
-    // entry name
114
-    var name = newName || this.name;
115
-    var success = function (entry) {
116
-        if (entry) {
117
-            if (successCallback) {
118
-                // create appropriate Entry object
119
-                var newFSName = entry.filesystemName || (entry.filesystem && entry.filesystem.name);
120
-                var fs = newFSName ? new FileSystem(newFSName, { name: '', fullPath: '/' }) : new FileSystem(parent.filesystem.name, { name: '', fullPath: '/' }); // eslint-disable-line no-undef
121
-                var result = (entry.isDirectory) ? new (require('./DirectoryEntry'))(entry.name, entry.fullPath, fs, entry.nativeURL) : new (require('cordova-plugin-file.FileEntry'))(entry.name, entry.fullPath, fs, entry.nativeURL);
122
-                successCallback(result);
123
-            }
124
-        } else {
125
-            // no Entry object returned
126
-            if (fail) {
127
-                fail(FileError.NOT_FOUND_ERR);
128
-            }
129
-        }
130
-    };
131
-
132
-    // copy
133
-    exec(success, fail, 'File', 'moveTo', [srcURL, parent.toInternalURL(), name]);
134
-};
135
-
136
-/**
137
- * Copy a directory to a different location.
138
- *
139
- * @param parent
140
- *            {DirectoryEntry} the directory to which to copy the entry
141
- * @param newName
142
- *            {DOMString} new name of the entry, defaults to the current name
143
- * @param successCallback
144
- *            {Function} called with the new Entry object
145
- * @param errorCallback
146
- *            {Function} called with a FileError
147
- */
148
-Entry.prototype.copyTo = function (parent, newName, successCallback, errorCallback) {
149
-    argscheck.checkArgs('oSFF', 'Entry.copyTo', arguments);
150
-    var fail = errorCallback && function (code) {
151
-        errorCallback(new FileError(code));
152
-    };
153
-    var srcURL = this.toInternalURL();
154
-        // entry name
155
-    var name = newName || this.name;
156
-    // success callback
157
-    var success = function (entry) {
158
-        if (entry) {
159
-            if (successCallback) {
160
-                // create appropriate Entry object
161
-                var newFSName = entry.filesystemName || (entry.filesystem && entry.filesystem.name);
162
-                var fs = newFSName ? new FileSystem(newFSName, { name: '', fullPath: '/' }) : new FileSystem(parent.filesystem.name, { name: '', fullPath: '/' }); // eslint-disable-line no-undef
163
-                var result = (entry.isDirectory) ? new (require('./DirectoryEntry'))(entry.name, entry.fullPath, fs, entry.nativeURL) : new (require('cordova-plugin-file.FileEntry'))(entry.name, entry.fullPath, fs, entry.nativeURL);
164
-                successCallback(result);
165
-            }
166
-        } else {
167
-            // no Entry object returned
168
-            if (fail) {
169
-                fail(FileError.NOT_FOUND_ERR);
170
-            }
171
-        }
172
-    };
173
-
174
-    // copy
175
-    exec(success, fail, 'File', 'copyTo', [srcURL, parent.toInternalURL(), name]);
176
-};
177
-
178
-/**
179
- * Return a URL that can be passed across the bridge to identify this entry.
180
- */
181
-Entry.prototype.toInternalURL = function () {
182
-    if (this.filesystem && this.filesystem.__format__) {
183
-        return this.filesystem.__format__(this.fullPath, this.nativeURL);
184
-    }
185
-};
186
-
187
-/**
188
- * Return a URL that can be used to identify this entry.
189
- * Use a URL that can be used to as the src attribute of a <video> or
190
- * <audio> tag. If that is not possible, construct a cdvfile:// URL.
191
- */
192
-Entry.prototype.toURL = function () {
193
-    if (this.nativeURL) {
194
-        return this.nativeURL;
195
-    }
196
-    // fullPath attribute may contain the full URL in the case that
197
-    // toInternalURL fails.
198
-    return this.toInternalURL() || 'file://localhost' + this.fullPath;
199
-};
200
-
201
-/**
202
- * Backwards-compatibility: In v1.0.0 - 1.0.2, .toURL would only return a
203
- * cdvfile:// URL, and this method was necessary to obtain URLs usable by the
204
- * webview.
205
- * See CB-6051, CB-6106, CB-6117, CB-6152, CB-6199, CB-6201, CB-6243, CB-6249,
206
- * and CB-6300.
207
- */
208
-Entry.prototype.toNativeURL = function () {
209
-    console.log("DEPRECATED: Update your code to use 'toURL'");
210
-    return this.toURL();
211
-};
212
-
213
-/**
214
- * Returns a URI that can be used to identify this entry.
215
- *
216
- * @param {DOMString} mimeType for a FileEntry, the mime type to be used to interpret the file, when loaded through this URI.
217
- * @return uri
218
- */
219
-Entry.prototype.toURI = function (mimeType) {
220
-    console.log("DEPRECATED: Update your code to use 'toURL'");
221
-    return this.toURL();
222
-};
223
-
224
-/**
225
- * Remove a file or directory. It is an error to attempt to delete a
226
- * directory that is not empty. It is an error to attempt to delete a
227
- * root directory of a file system.
228
- *
229
- * @param successCallback {Function} called with no parameters
230
- * @param errorCallback {Function} called with a FileError
231
- */
232
-Entry.prototype.remove = function (successCallback, errorCallback) {
233
-    argscheck.checkArgs('FF', 'Entry.remove', arguments);
234
-    var fail = errorCallback && function (code) {
235
-        errorCallback(new FileError(code));
236
-    };
237
-    exec(successCallback, fail, 'File', 'remove', [this.toInternalURL()]);
238
-};
239
-
240
-/**
241
- * Look up the parent DirectoryEntry of this entry.
242
- *
243
- * @param successCallback {Function} called with the parent DirectoryEntry object
244
- * @param errorCallback {Function} called with a FileError
245
- */
246
-Entry.prototype.getParent = function (successCallback, errorCallback) {
247
-    argscheck.checkArgs('FF', 'Entry.getParent', arguments);
248
-    var fs = this.filesystem;
249
-    var win = successCallback && function (result) {
250
-        var DirectoryEntry = require('./DirectoryEntry');
251
-        var entry = new DirectoryEntry(result.name, result.fullPath, fs, result.nativeURL);
252
-        successCallback(entry);
253
-    };
254
-    var fail = errorCallback && function (code) {
255
-        errorCallback(new FileError(code));
256
-    };
257
-    exec(win, fail, 'File', 'getParent', [this.toInternalURL()]);
258
-};
259
-
260
-module.exports = Entry;

+ 0
- 78
node_modules/cordova-plugin-file/www/File.js Datei anzeigen

@@ -1,78 +0,0 @@
1
-/*
2
- *
3
- * Licensed to the Apache Software Foundation (ASF) under one
4
- * or more contributor license agreements.  See the NOTICE file
5
- * distributed with this work for additional information
6
- * regarding copyright ownership.  The ASF licenses this file
7
- * to you under the Apache License, Version 2.0 (the
8
- * "License"); you may not use this file except in compliance
9
- * with the License.  You may obtain a copy of the License at
10
- *
11
- *   http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing,
14
- * software distributed under the License is distributed on an
15
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
- * KIND, either express or implied.  See the License for the
17
- * specific language governing permissions and limitations
18
- * under the License.
19
- *
20
-*/
21
-
22
-/**
23
- * Constructor.
24
- * name {DOMString} name of the file, without path information
25
- * fullPath {DOMString} the full path of the file, including the name
26
- * type {DOMString} mime type
27
- * lastModifiedDate {Date} last modified date
28
- * size {Number} size of the file in bytes
29
- */
30
-
31
-var File = function (name, localURL, type, lastModifiedDate, size) {
32
-    this.name = name || '';
33
-    this.localURL = localURL || null;
34
-    this.type = type || null;
35
-    this.lastModified = lastModifiedDate || null;
36
-    // For backwards compatibility, store the timestamp in lastModifiedDate as well
37
-    this.lastModifiedDate = lastModifiedDate || null;
38
-    this.size = size || 0;
39
-
40
-    // These store the absolute start and end for slicing the file.
41
-    this.start = 0;
42
-    this.end = this.size;
43
-};
44
-
45
-/**
46
- * Returns a "slice" of the file. Since Cordova Files don't contain the actual
47
- * content, this really returns a File with adjusted start and end.
48
- * Slices of slices are supported.
49
- * start {Number} The index at which to start the slice (inclusive).
50
- * end {Number} The index at which to end the slice (exclusive).
51
- */
52
-File.prototype.slice = function (start, end) {
53
-    var size = this.end - this.start;
54
-    var newStart = 0;
55
-    var newEnd = size;
56
-    if (arguments.length) {
57
-        if (start < 0) {
58
-            newStart = Math.max(size + start, 0);
59
-        } else {
60
-            newStart = Math.min(size, start);
61
-        }
62
-    }
63
-
64
-    if (arguments.length >= 2) {
65
-        if (end < 0) {
66
-            newEnd = Math.max(size + end, 0);
67
-        } else {
68
-            newEnd = Math.min(end, size);
69
-        }
70
-    }
71
-
72
-    var newFile = new File(this.name, this.localURL, this.type, this.lastModified, this.size);
73
-    newFile.start = this.start + newStart;
74
-    newFile.end = this.start + newEnd;
75
-    return newFile;
76
-};
77
-
78
-module.exports = File;

+ 0
- 92
node_modules/cordova-plugin-file/www/FileEntry.js Datei anzeigen

@@ -1,92 +0,0 @@
1
-/*
2
- *
3
- * Licensed to the Apache Software Foundation (ASF) under one
4
- * or more contributor license agreements.  See the NOTICE file
5
- * distributed with this work for additional information
6
- * regarding copyright ownership.  The ASF licenses this file
7
- * to you under the Apache License, Version 2.0 (the
8
- * "License"); you may not use this file except in compliance
9
- * with the License.  You may obtain a copy of the License at
10
- *
11
- *   http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing,
14
- * software distributed under the License is distributed on an
15
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
- * KIND, either express or implied.  See the License for the
17
- * specific language governing permissions and limitations
18
- * under the License.
19
- *
20
-*/
21
-
22
-var utils = require('cordova/utils');
23
-var exec = require('cordova/exec');
24
-var Entry = require('./Entry');
25
-var FileWriter = require('./FileWriter');
26
-var File = require('./File');
27
-var FileError = require('./FileError');
28
-
29
-/**
30
- * An interface representing a file on the file system.
31
- *
32
- * {boolean} isFile always true (readonly)
33
- * {boolean} isDirectory always false (readonly)
34
- * {DOMString} name of the file, excluding the path leading to it (readonly)
35
- * {DOMString} fullPath the absolute full path to the file (readonly)
36
- * {FileSystem} filesystem on which the file resides (readonly)
37
- */
38
-var FileEntry = function (name, fullPath, fileSystem, nativeURL) {
39
-    // remove trailing slash if it is present
40
-    if (fullPath && /\/$/.test(fullPath)) {
41
-        fullPath = fullPath.substring(0, fullPath.length - 1);
42
-    }
43
-    if (nativeURL && /\/$/.test(nativeURL)) {
44
-        nativeURL = nativeURL.substring(0, nativeURL.length - 1);
45
-    }
46
-
47
-    FileEntry.__super__.constructor.apply(this, [true, false, name, fullPath, fileSystem, nativeURL]);
48
-};
49
-
50
-utils.extend(FileEntry, Entry);
51
-
52
-/**
53
- * Creates a new FileWriter associated with the file that this FileEntry represents.
54
- *
55
- * @param {Function} successCallback is called with the new FileWriter
56
- * @param {Function} errorCallback is called with a FileError
57
- */
58
-FileEntry.prototype.createWriter = function (successCallback, errorCallback) {
59
-    this.file(function (filePointer) {
60
-        var writer = new FileWriter(filePointer);
61
-
62
-        if (writer.localURL === null || writer.localURL === '') {
63
-            if (errorCallback) {
64
-                errorCallback(new FileError(FileError.INVALID_STATE_ERR));
65
-            }
66
-        } else {
67
-            if (successCallback) {
68
-                successCallback(writer);
69
-            }
70
-        }
71
-    }, errorCallback);
72
-};
73
-
74
-/**
75
- * Returns a File that represents the current state of the file that this FileEntry represents.
76
- *
77
- * @param {Function} successCallback is called with the new File object
78
- * @param {Function} errorCallback is called with a FileError
79
- */
80
-FileEntry.prototype.file = function (successCallback, errorCallback) {
81
-    var localURL = this.toInternalURL();
82
-    var win = successCallback && function (f) {
83
-        var file = new File(f.name, localURL, f.type, f.lastModifiedDate, f.size);
84
-        successCallback(file);
85
-    };
86
-    var fail = errorCallback && function (code) {
87
-        errorCallback(new FileError(code));
88
-    };
89
-    exec(win, fail, 'File', 'getFileMetadata', [localURL]);
90
-};
91
-
92
-module.exports = FileEntry;

+ 0
- 46
node_modules/cordova-plugin-file/www/FileError.js Datei anzeigen

@@ -1,46 +0,0 @@
1
-/*
2
- *
3
- * Licensed to the Apache Software Foundation (ASF) under one
4
- * or more contributor license agreements.  See the NOTICE file
5
- * distributed with this work for additional information
6
- * regarding copyright ownership.  The ASF licenses this file
7
- * to you under the Apache License, Version 2.0 (the
8
- * "License"); you may not use this file except in compliance
9
- * with the License.  You may obtain a copy of the License at
10
- *
11
- *   http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing,
14
- * software distributed under the License is distributed on an
15
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
- * KIND, either express or implied.  See the License for the
17
- * specific language governing permissions and limitations
18
- * under the License.
19
- *
20
-*/
21
-
22
-/**
23
- * FileError
24
- */
25
-function FileError (error) {
26
-    this.code = error || null;
27
-}
28
-
29
-// File error codes
30
-// Found in DOMException
31
-FileError.NOT_FOUND_ERR = 1;
32
-FileError.SECURITY_ERR = 2;
33
-FileError.ABORT_ERR = 3;
34
-
35
-// Added by File API specification
36
-FileError.NOT_READABLE_ERR = 4;
37
-FileError.ENCODING_ERR = 5;
38
-FileError.NO_MODIFICATION_ALLOWED_ERR = 6;
39
-FileError.INVALID_STATE_ERR = 7;
40
-FileError.SYNTAX_ERR = 8;
41
-FileError.INVALID_MODIFICATION_ERR = 9;
42
-FileError.QUOTA_EXCEEDED_ERR = 10;
43
-FileError.TYPE_MISMATCH_ERR = 11;
44
-FileError.PATH_EXISTS_ERR = 12;
45
-
46
-module.exports = FileError;

+ 0
- 298
node_modules/cordova-plugin-file/www/FileReader.js Datei anzeigen

@@ -1,298 +0,0 @@
1
-/*
2
- *
3
- * Licensed to the Apache Software Foundation (ASF) under one
4
- * or more contributor license agreements.  See the NOTICE file
5
- * distributed with this work for additional information
6
- * regarding copyright ownership.  The ASF licenses this file
7
- * to you under the Apache License, Version 2.0 (the
8
- * "License"); you may not use this file except in compliance
9
- * with the License.  You may obtain a copy of the License at
10
- *
11
- *   http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing,
14
- * software distributed under the License is distributed on an
15
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
- * KIND, either express or implied.  See the License for the
17
- * specific language governing permissions and limitations
18
- * under the License.
19
- *
20
-*/
21
-
22
-var exec = require('cordova/exec');
23
-var modulemapper = require('cordova/modulemapper');
24
-var utils = require('cordova/utils');
25
-var FileError = require('./FileError');
26
-var ProgressEvent = require('./ProgressEvent');
27
-var origFileReader = modulemapper.getOriginalSymbol(window, 'FileReader');
28
-
29
-/**
30
- * This class reads the mobile device file system.
31
- *
32
- * For Android:
33
- *      The root directory is the root of the file system.
34
- *      To read from the SD card, the file name is "sdcard/my_file.txt"
35
- * @constructor
36
- */
37
-var FileReader = function () {
38
-    this._readyState = 0;
39
-    this._error = null;
40
-    this._result = null;
41
-    this._progress = null;
42
-    this._localURL = '';
43
-    this._realReader = origFileReader ? new origFileReader() : {}; // eslint-disable-line new-cap
44
-};
45
-
46
-/**
47
- * Defines the maximum size to read at a time via the native API. The default value is a compromise between
48
- * minimizing the overhead of many exec() calls while still reporting progress frequently enough for large files.
49
- * (Note attempts to allocate more than a few MB of contiguous memory on the native side are likely to cause
50
- * OOM exceptions, while the JS engine seems to have fewer problems managing large strings or ArrayBuffers.)
51
- */
52
-FileReader.READ_CHUNK_SIZE = 256 * 1024;
53
-
54
-// States
55
-FileReader.EMPTY = 0;
56
-FileReader.LOADING = 1;
57
-FileReader.DONE = 2;
58
-
59
-utils.defineGetter(FileReader.prototype, 'readyState', function () {
60
-    return this._localURL ? this._readyState : this._realReader.readyState;
61
-});
62
-
63
-utils.defineGetter(FileReader.prototype, 'error', function () {
64
-    return this._localURL ? this._error : this._realReader.error;
65
-});
66
-
67
-utils.defineGetter(FileReader.prototype, 'result', function () {
68
-    return this._localURL ? this._result : this._realReader.result;
69
-});
70
-
71
-function defineEvent (eventName) {
72
-    utils.defineGetterSetter(FileReader.prototype, eventName, function () {
73
-        return this._realReader[eventName] || null;
74
-    }, function (value) {
75
-        this._realReader[eventName] = value;
76
-    });
77
-}
78
-defineEvent('onloadstart');    // When the read starts.
79
-defineEvent('onprogress');     // While reading (and decoding) file or fileBlob data, and reporting partial file data (progress.loaded/progress.total)
80
-defineEvent('onload');         // When the read has successfully completed.
81
-defineEvent('onerror');        // When the read has failed (see errors).
82
-defineEvent('onloadend');      // When the request has completed (either in success or failure).
83
-defineEvent('onabort');        // When the read has been aborted. For instance, by invoking the abort() method.
84
-
85
-function initRead (reader, file) {
86
-    // Already loading something
87
-    if (reader.readyState === FileReader.LOADING) {
88
-        throw new FileError(FileError.INVALID_STATE_ERR);
89
-    }
90
-
91
-    reader._result = null;
92
-    reader._error = null;
93
-    reader._progress = 0;
94
-    reader._readyState = FileReader.LOADING;
95
-
96
-    if (typeof file.localURL === 'string') {
97
-        reader._localURL = file.localURL;
98
-    } else {
99
-        reader._localURL = '';
100
-        return true;
101
-    }
102
-
103
-    if (reader.onloadstart) {
104
-        reader.onloadstart(new ProgressEvent('loadstart', {target: reader}));
105
-    }
106
-}
107
-
108
-/**
109
- * Callback used by the following read* functions to handle incremental or final success.
110
- * Must be bound to the FileReader's this along with all but the last parameter,
111
- * e.g. readSuccessCallback.bind(this, "readAsText", "UTF-8", offset, totalSize, accumulate)
112
- * @param readType The name of the read function to call.
113
- * @param encoding Text encoding, or null if this is not a text type read.
114
- * @param offset Starting offset of the read.
115
- * @param totalSize Total number of bytes or chars to read.
116
- * @param accumulate A function that takes the callback result and accumulates it in this._result.
117
- * @param r Callback result returned by the last read exec() call, or null to begin reading.
118
- */
119
-function readSuccessCallback (readType, encoding, offset, totalSize, accumulate, r) {
120
-    if (this._readyState === FileReader.DONE) {
121
-        return;
122
-    }
123
-
124
-    var CHUNK_SIZE = FileReader.READ_CHUNK_SIZE;
125
-    if (readType === 'readAsDataURL') {
126
-        // Windows proxy does not support reading file slices as Data URLs
127
-        // so read the whole file at once.
128
-        CHUNK_SIZE = cordova.platformId === 'windows' ? totalSize : // eslint-disable-line no-undef
129
-            // Calculate new chunk size for data URLs to be multiply of 3
130
-            // Otherwise concatenated base64 chunks won't be valid base64 data
131
-            FileReader.READ_CHUNK_SIZE - (FileReader.READ_CHUNK_SIZE % 3) + 3;
132
-    }
133
-
134
-    if (typeof r !== 'undefined') {
135
-        accumulate(r);
136
-        this._progress = Math.min(this._progress + CHUNK_SIZE, totalSize);
137
-
138
-        if (typeof this.onprogress === 'function') {
139
-            this.onprogress(new ProgressEvent('progress', {loaded: this._progress, total: totalSize}));
140
-        }
141
-    }
142
-
143
-    if (typeof r === 'undefined' || this._progress < totalSize) {
144
-        var execArgs = [
145
-            this._localURL,
146
-            offset + this._progress,
147
-            offset + this._progress + Math.min(totalSize - this._progress, CHUNK_SIZE)];
148
-        if (encoding) {
149
-            execArgs.splice(1, 0, encoding);
150
-        }
151
-        exec(
152
-            readSuccessCallback.bind(this, readType, encoding, offset, totalSize, accumulate),
153
-            readFailureCallback.bind(this),
154
-            'File', readType, execArgs);
155
-    } else {
156
-        this._readyState = FileReader.DONE;
157
-
158
-        if (typeof this.onload === 'function') {
159
-            this.onload(new ProgressEvent('load', {target: this}));
160
-        }
161
-
162
-        if (typeof this.onloadend === 'function') {
163
-            this.onloadend(new ProgressEvent('loadend', {target: this}));
164
-        }
165
-    }
166
-}
167
-
168
-/**
169
- * Callback used by the following read* functions to handle errors.
170
- * Must be bound to the FileReader's this, e.g. readFailureCallback.bind(this)
171
- */
172
-function readFailureCallback (e) {
173
-    if (this._readyState === FileReader.DONE) {
174
-        return;
175
-    }
176
-
177
-    this._readyState = FileReader.DONE;
178
-    this._result = null;
179
-    this._error = new FileError(e);
180
-
181
-    if (typeof this.onerror === 'function') {
182
-        this.onerror(new ProgressEvent('error', {target: this}));
183
-    }
184
-
185
-    if (typeof this.onloadend === 'function') {
186
-        this.onloadend(new ProgressEvent('loadend', {target: this}));
187
-    }
188
-}
189
-
190
-/**
191
- * Abort reading file.
192
- */
193
-FileReader.prototype.abort = function () {
194
-    if (origFileReader && !this._localURL) {
195
-        return this._realReader.abort();
196
-    }
197
-    this._result = null;
198
-
199
-    if (this._readyState === FileReader.DONE || this._readyState === FileReader.EMPTY) {
200
-        return;
201
-    }
202
-
203
-    this._readyState = FileReader.DONE;
204
-
205
-    // If abort callback
206
-    if (typeof this.onabort === 'function') {
207
-        this.onabort(new ProgressEvent('abort', {target: this}));
208
-    }
209
-    // If load end callback
210
-    if (typeof this.onloadend === 'function') {
211
-        this.onloadend(new ProgressEvent('loadend', {target: this}));
212
-    }
213
-};
214
-
215
-/**
216
- * Read text file.
217
- *
218
- * @param file          {File} File object containing file properties
219
- * @param encoding      [Optional] (see http://www.iana.org/assignments/character-sets)
220
- */
221
-FileReader.prototype.readAsText = function (file, encoding) {
222
-    if (initRead(this, file)) {
223
-        return this._realReader.readAsText(file, encoding);
224
-    }
225
-
226
-    // Default encoding is UTF-8
227
-    var enc = encoding || 'UTF-8';
228
-
229
-    var totalSize = file.end - file.start;
230
-    readSuccessCallback.bind(this)('readAsText', enc, file.start, totalSize, function (r) {
231
-        if (this._progress === 0) {
232
-            this._result = '';
233
-        }
234
-        this._result += r;
235
-    }.bind(this));
236
-};
237
-
238
-/**
239
- * Read file and return data as a base64 encoded data url.
240
- * A data url is of the form:
241
- *      data:[<mediatype>][;base64],<data>
242
- *
243
- * @param file          {File} File object containing file properties
244
- */
245
-FileReader.prototype.readAsDataURL = function (file) {
246
-    if (initRead(this, file)) {
247
-        return this._realReader.readAsDataURL(file);
248
-    }
249
-
250
-    var totalSize = file.end - file.start;
251
-    readSuccessCallback.bind(this)('readAsDataURL', null, file.start, totalSize, function (r) {
252
-        var commaIndex = r.indexOf(',');
253
-        if (this._progress === 0) {
254
-            this._result = r;
255
-        } else {
256
-            this._result += r.substring(commaIndex + 1);
257
-        }
258
-    }.bind(this));
259
-};
260
-
261
-/**
262
- * Read file and return data as a binary data.
263
- *
264
- * @param file          {File} File object containing file properties
265
- */
266
-FileReader.prototype.readAsBinaryString = function (file) {
267
-    if (initRead(this, file)) {
268
-        return this._realReader.readAsBinaryString(file);
269
-    }
270
-
271
-    var totalSize = file.end - file.start;
272
-    readSuccessCallback.bind(this)('readAsBinaryString', null, file.start, totalSize, function (r) {
273
-        if (this._progress === 0) {
274
-            this._result = '';
275
-        }
276
-        this._result += r;
277
-    }.bind(this));
278
-};
279
-
280
-/**
281
- * Read file and return data as a binary data.
282
- *
283
- * @param file          {File} File object containing file properties
284
- */
285
-FileReader.prototype.readAsArrayBuffer = function (file) {
286
-    if (initRead(this, file)) {
287
-        return this._realReader.readAsArrayBuffer(file);
288
-    }
289
-
290
-    var totalSize = file.end - file.start;
291
-    readSuccessCallback.bind(this)('readAsArrayBuffer', null, file.start, totalSize, function (r) {
292
-        var resultArray = (this._progress === 0 ? new Uint8Array(totalSize) : new Uint8Array(this._result));
293
-        resultArray.set(new Uint8Array(r), this._progress);
294
-        this._result = resultArray.buffer;
295
-    }.bind(this));
296
-};
297
-
298
-module.exports = FileReader;

+ 0
- 55
node_modules/cordova-plugin-file/www/FileSystem.js Datei anzeigen

@@ -1,55 +0,0 @@
1
-/*
2
- *
3
- * Licensed to the Apache Software Foundation (ASF) under one
4
- * or more contributor license agreements.  See the NOTICE file
5
- * distributed with this work for additional information
6
- * regarding copyright ownership.  The ASF licenses this file
7
- * to you under the Apache License, Version 2.0 (the
8
- * "License"); you may not use this file except in compliance
9
- * with the License.  You may obtain a copy of the License at
10
- *
11
- *   http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing,
14
- * software distributed under the License is distributed on an
15
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
- * KIND, either express or implied.  See the License for the
17
- * specific language governing permissions and limitations
18
- * under the License.
19
- *
20
-*/
21
-
22
-var DirectoryEntry = require('./DirectoryEntry');
23
-
24
-/**
25
- * An interface representing a file system
26
- *
27
- * @constructor
28
- * {DOMString} name the unique name of the file system (readonly)
29
- * {DirectoryEntry} root directory of the file system (readonly)
30
- */
31
-var FileSystem = function (name, root) {
32
-    this.name = name;
33
-    if (root) {
34
-        this.root = new DirectoryEntry(root.name, root.fullPath, this, root.nativeURL);
35
-    } else {
36
-        this.root = new DirectoryEntry(this.name, '/', this);
37
-    }
38
-};
39
-
40
-FileSystem.prototype.__format__ = function (fullPath, nativeUrl) {
41
-    return fullPath;
42
-};
43
-
44
-FileSystem.prototype.toJSON = function () {
45
-    return '<FileSystem: ' + this.name + '>';
46
-};
47
-
48
-// Use instead of encodeURI() when encoding just the path part of a URI rather than an entire URI.
49
-FileSystem.encodeURIPath = function (path) {
50
-    // Because # is a valid filename character, it must be encoded to prevent part of the
51
-    // path from being parsed as a URI fragment.
52
-    return encodeURI(path).replace(/#/g, '%23');
53
-};
54
-
55
-module.exports = FileSystem;

+ 0
- 41
node_modules/cordova-plugin-file/www/FileUploadOptions.js Datei anzeigen

@@ -1,41 +0,0 @@
1
-/*
2
- *
3
- * Licensed to the Apache Software Foundation (ASF) under one
4
- * or more contributor license agreements.  See the NOTICE file
5
- * distributed with this work for additional information
6
- * regarding copyright ownership.  The ASF licenses this file
7
- * to you under the Apache License, Version 2.0 (the
8
- * "License"); you may not use this file except in compliance
9
- * with the License.  You may obtain a copy of the License at
10
- *
11
- *   http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing,
14
- * software distributed under the License is distributed on an
15
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
- * KIND, either express or implied.  See the License for the
17
- * specific language governing permissions and limitations
18
- * under the License.
19
- *
20
-*/
21
-
22
-/**
23
- * Options to customize the HTTP request used to upload files.
24
- * @constructor
25
- * @param fileKey {String}   Name of file request parameter.
26
- * @param fileName {String}  Filename to be used by the server. Defaults to image.jpg.
27
- * @param mimeType {String}  Mimetype of the uploaded file. Defaults to image/jpeg.
28
- * @param params {Object}    Object with key: value params to send to the server.
29
- * @param headers {Object}   Keys are header names, values are header values. Multiple
30
- *                           headers of the same name are not supported.
31
- */
32
-var FileUploadOptions = function (fileKey, fileName, mimeType, params, headers, httpMethod) {
33
-    this.fileKey = fileKey || null;
34
-    this.fileName = fileName || null;
35
-    this.mimeType = mimeType || null;
36
-    this.params = params || null;
37
-    this.headers = headers || null;
38
-    this.httpMethod = httpMethod || null;
39
-};
40
-
41
-module.exports = FileUploadOptions;

+ 0
- 30
node_modules/cordova-plugin-file/www/FileUploadResult.js Datei anzeigen

@@ -1,30 +0,0 @@
1
-/*
2
- *
3
- * Licensed to the Apache Software Foundation (ASF) under one
4
- * or more contributor license agreements.  See the NOTICE file
5
- * distributed with this work for additional information
6
- * regarding copyright ownership.  The ASF licenses this file
7
- * to you under the Apache License, Version 2.0 (the
8
- * "License"); you may not use this file except in compliance
9
- * with the License.  You may obtain a copy of the License at
10
- *
11
- *   http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing,
14
- * software distributed under the License is distributed on an
15
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
- * KIND, either express or implied.  See the License for the
17
- * specific language governing permissions and limitations
18
- * under the License.
19
- *
20
-*/
21
-
22
-/**
23
- * FileUploadResult
24
- * @constructor
25
- */
26
-module.exports = function FileUploadResult (size, code, content) {
27
-    this.bytesSent = size;
28
-    this.responseCode = code;
29
-    this.response = content;
30
-};

+ 0
- 325
node_modules/cordova-plugin-file/www/FileWriter.js Datei anzeigen

@@ -1,325 +0,0 @@
1
-/*
2
- *
3
- * Licensed to the Apache Software Foundation (ASF) under one
4
- * or more contributor license agreements.  See the NOTICE file
5
- * distributed with this work for additional information
6
- * regarding copyright ownership.  The ASF licenses this file
7
- * to you under the Apache License, Version 2.0 (the
8
- * "License"); you may not use this file except in compliance
9
- * with the License.  You may obtain a copy of the License at
10
- *
11
- *   http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing,
14
- * software distributed under the License is distributed on an
15
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
- * KIND, either express or implied.  See the License for the
17
- * specific language governing permissions and limitations
18
- * under the License.
19
- *
20
-*/
21
-
22
-var exec = require('cordova/exec');
23
-var FileError = require('./FileError');
24
-var FileReader = require('./FileReader');
25
-var ProgressEvent = require('./ProgressEvent');
26
-
27
-/**
28
- * This class writes to the mobile device file system.
29
- *
30
- * For Android:
31
- *      The root directory is the root of the file system.
32
- *      To write to the SD card, the file name is "sdcard/my_file.txt"
33
- *
34
- * @constructor
35
- * @param file {File} File object containing file properties
36
- * @param append if true write to the end of the file, otherwise overwrite the file
37
- */
38
-var FileWriter = function (file) {
39
-    this.fileName = '';
40
-    this.length = 0;
41
-    if (file) {
42
-        this.localURL = file.localURL || file;
43
-        this.length = file.size || 0;
44
-    }
45
-    // default is to write at the beginning of the file
46
-    this.position = 0;
47
-
48
-    this.readyState = 0; // EMPTY
49
-
50
-    this.result = null;
51
-
52
-    // Error
53
-    this.error = null;
54
-
55
-    // Event handlers
56
-    this.onwritestart = null;   // When writing starts
57
-    this.onprogress = null;     // While writing the file, and reporting partial file data
58
-    this.onwrite = null;        // When the write has successfully completed.
59
-    this.onwriteend = null;     // When the request has completed (either in success or failure).
60
-    this.onabort = null;        // When the write has been aborted. For instance, by invoking the abort() method.
61
-    this.onerror = null;        // When the write has failed (see errors).
62
-};
63
-
64
-// States
65
-FileWriter.INIT = 0;
66
-FileWriter.WRITING = 1;
67
-FileWriter.DONE = 2;
68
-
69
-/**
70
- * Abort writing file.
71
- */
72
-FileWriter.prototype.abort = function () {
73
-    // check for invalid state
74
-    if (this.readyState === FileWriter.DONE || this.readyState === FileWriter.INIT) {
75
-        throw new FileError(FileError.INVALID_STATE_ERR);
76
-    }
77
-
78
-    // set error
79
-    this.error = new FileError(FileError.ABORT_ERR);
80
-
81
-    this.readyState = FileWriter.DONE;
82
-
83
-    // If abort callback
84
-    if (typeof this.onabort === 'function') {
85
-        this.onabort(new ProgressEvent('abort', {'target': this}));
86
-    }
87
-
88
-    // If write end callback
89
-    if (typeof this.onwriteend === 'function') {
90
-        this.onwriteend(new ProgressEvent('writeend', {'target': this}));
91
-    }
92
-};
93
-
94
-/**
95
- * Writes data to the file
96
- *
97
- * @param data text or blob to be written
98
- * @param isPendingBlobReadResult {Boolean} true if the data is the pending blob read operation result
99
- */
100
-FileWriter.prototype.write = function (data, isPendingBlobReadResult) {
101
-
102
-    var that = this;
103
-    var supportsBinary = (typeof window.Blob !== 'undefined' && typeof window.ArrayBuffer !== 'undefined');
104
-    /* eslint-disable no-undef */
105
-    var isProxySupportBlobNatively = (cordova.platformId === 'windows8' || cordova.platformId === 'windows');
106
-    var isBinary;
107
-
108
-    // Check to see if the incoming data is a blob
109
-    if (data instanceof File || (!isProxySupportBlobNatively && supportsBinary && data instanceof Blob)) {
110
-        var fileReader = new FileReader();
111
-        /* eslint-enable no-undef */
112
-        fileReader.onload = function () {
113
-            // Call this method again, with the arraybuffer as argument
114
-            FileWriter.prototype.write.call(that, this.result, true /* isPendingBlobReadResult */);
115
-        };
116
-        fileReader.onerror = function () {
117
-            // DONE state
118
-            that.readyState = FileWriter.DONE;
119
-
120
-            // Save error
121
-            that.error = this.error;
122
-
123
-            // If onerror callback
124
-            if (typeof that.onerror === 'function') {
125
-                that.onerror(new ProgressEvent('error', {'target': that}));
126
-            }
127
-
128
-            // If onwriteend callback
129
-            if (typeof that.onwriteend === 'function') {
130
-                that.onwriteend(new ProgressEvent('writeend', {'target': that}));
131
-            }
132
-        };
133
-
134
-        // WRITING state
135
-        this.readyState = FileWriter.WRITING;
136
-
137
-        if (supportsBinary) {
138
-            fileReader.readAsArrayBuffer(data);
139
-        } else {
140
-            fileReader.readAsText(data);
141
-        }
142
-        return;
143
-    }
144
-
145
-    // Mark data type for safer transport over the binary bridge
146
-    isBinary = supportsBinary && (data instanceof ArrayBuffer);
147
-    if (isBinary && cordova.platformId === 'windowsphone') { // eslint-disable-line no-undef
148
-        // create a plain array, using the keys from the Uint8Array view so that we can serialize it
149
-        data = Array.apply(null, new Uint8Array(data));
150
-    }
151
-
152
-    // Throw an exception if we are already writing a file
153
-    if (this.readyState === FileWriter.WRITING && !isPendingBlobReadResult) {
154
-        throw new FileError(FileError.INVALID_STATE_ERR);
155
-    }
156
-
157
-    // WRITING state
158
-    this.readyState = FileWriter.WRITING;
159
-
160
-    var me = this;
161
-
162
-    // If onwritestart callback
163
-    if (typeof me.onwritestart === 'function') {
164
-        me.onwritestart(new ProgressEvent('writestart', {'target': me}));
165
-    }
166
-
167
-    // Write file
168
-    exec(
169
-        // Success callback
170
-        function (r) {
171
-            // If DONE (cancelled), then don't do anything
172
-            if (me.readyState === FileWriter.DONE) {
173
-                return;
174
-            }
175
-
176
-            // position always increases by bytes written because file would be extended
177
-            me.position += r;
178
-            // The length of the file is now where we are done writing.
179
-
180
-            me.length = me.position;
181
-
182
-            // DONE state
183
-            me.readyState = FileWriter.DONE;
184
-
185
-            // If onwrite callback
186
-            if (typeof me.onwrite === 'function') {
187
-                me.onwrite(new ProgressEvent('write', {'target': me}));
188
-            }
189
-
190
-            // If onwriteend callback
191
-            if (typeof me.onwriteend === 'function') {
192
-                me.onwriteend(new ProgressEvent('writeend', {'target': me}));
193
-            }
194
-        },
195
-        // Error callback
196
-        function (e) {
197
-            // If DONE (cancelled), then don't do anything
198
-            if (me.readyState === FileWriter.DONE) {
199
-                return;
200
-            }
201
-
202
-            // DONE state
203
-            me.readyState = FileWriter.DONE;
204
-
205
-            // Save error
206
-            me.error = new FileError(e);
207
-
208
-            // If onerror callback
209
-            if (typeof me.onerror === 'function') {
210
-                me.onerror(new ProgressEvent('error', {'target': me}));
211
-            }
212
-
213
-            // If onwriteend callback
214
-            if (typeof me.onwriteend === 'function') {
215
-                me.onwriteend(new ProgressEvent('writeend', {'target': me}));
216
-            }
217
-        }, 'File', 'write', [this.localURL, data, this.position, isBinary]);
218
-};
219
-
220
-/**
221
- * Moves the file pointer to the location specified.
222
- *
223
- * If the offset is a negative number the position of the file
224
- * pointer is rewound.  If the offset is greater than the file
225
- * size the position is set to the end of the file.
226
- *
227
- * @param offset is the location to move the file pointer to.
228
- */
229
-FileWriter.prototype.seek = function (offset) {
230
-    // Throw an exception if we are already writing a file
231
-    if (this.readyState === FileWriter.WRITING) {
232
-        throw new FileError(FileError.INVALID_STATE_ERR);
233
-    }
234
-
235
-    if (!offset && offset !== 0) {
236
-        return;
237
-    }
238
-
239
-    // See back from end of file.
240
-    if (offset < 0) {
241
-        this.position = Math.max(offset + this.length, 0);
242
-    // Offset is bigger than file size so set position
243
-    // to the end of the file.
244
-    } else if (offset > this.length) {
245
-        this.position = this.length;
246
-    // Offset is between 0 and file size so set the position
247
-    // to start writing.
248
-    } else {
249
-        this.position = offset;
250
-    }
251
-};
252
-
253
-/**
254
- * Truncates the file to the size specified.
255
- *
256
- * @param size to chop the file at.
257
- */
258
-FileWriter.prototype.truncate = function (size) {
259
-    // Throw an exception if we are already writing a file
260
-    if (this.readyState === FileWriter.WRITING) {
261
-        throw new FileError(FileError.INVALID_STATE_ERR);
262
-    }
263
-
264
-    // WRITING state
265
-    this.readyState = FileWriter.WRITING;
266
-
267
-    var me = this;
268
-
269
-    // If onwritestart callback
270
-    if (typeof me.onwritestart === 'function') {
271
-        me.onwritestart(new ProgressEvent('writestart', {'target': this}));
272
-    }
273
-
274
-    // Write file
275
-    exec(
276
-        // Success callback
277
-        function (r) {
278
-            // If DONE (cancelled), then don't do anything
279
-            if (me.readyState === FileWriter.DONE) {
280
-                return;
281
-            }
282
-
283
-            // DONE state
284
-            me.readyState = FileWriter.DONE;
285
-
286
-            // Update the length of the file
287
-            me.length = r;
288
-            me.position = Math.min(me.position, r);
289
-
290
-            // If onwrite callback
291
-            if (typeof me.onwrite === 'function') {
292
-                me.onwrite(new ProgressEvent('write', {'target': me}));
293
-            }
294
-
295
-            // If onwriteend callback
296
-            if (typeof me.onwriteend === 'function') {
297
-                me.onwriteend(new ProgressEvent('writeend', {'target': me}));
298
-            }
299
-        },
300
-        // Error callback
301
-        function (e) {
302
-            // If DONE (cancelled), then don't do anything
303
-            if (me.readyState === FileWriter.DONE) {
304
-                return;
305
-            }
306
-
307
-            // DONE state
308
-            me.readyState = FileWriter.DONE;
309
-
310
-            // Save error
311
-            me.error = new FileError(e);
312
-
313
-            // If onerror callback
314
-            if (typeof me.onerror === 'function') {
315
-                me.onerror(new ProgressEvent('error', {'target': me}));
316
-            }
317
-
318
-            // If onwriteend callback
319
-            if (typeof me.onwriteend === 'function') {
320
-                me.onwriteend(new ProgressEvent('writeend', {'target': me}));
321
-            }
322
-        }, 'File', 'truncate', [this.localURL, size]);
323
-};
324
-
325
-module.exports = FileWriter;

+ 0
- 36
node_modules/cordova-plugin-file/www/Flags.js Datei anzeigen

@@ -1,36 +0,0 @@
1
-/*
2
- *
3
- * Licensed to the Apache Software Foundation (ASF) under one
4
- * or more contributor license agreements.  See the NOTICE file
5
- * distributed with this work for additional information
6
- * regarding copyright ownership.  The ASF licenses this file
7
- * to you under the Apache License, Version 2.0 (the
8
- * "License"); you may not use this file except in compliance
9
- * with the License.  You may obtain a copy of the License at
10
- *
11
- *   http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing,
14
- * software distributed under the License is distributed on an
15
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
- * KIND, either express or implied.  See the License for the
17
- * specific language governing permissions and limitations
18
- * under the License.
19
- *
20
-*/
21
-
22
-/**
23
- * Supplies arguments to methods that lookup or create files and directories.
24
- *
25
- * @param create
26
- *            {boolean} file or directory if it doesn't exist
27
- * @param exclusive
28
- *            {boolean} used with create; if true the command will fail if
29
- *            target path exists
30
- */
31
-function Flags (create, exclusive) {
32
-    this.create = create || false;
33
-    this.exclusive = exclusive || false;
34
-}
35
-
36
-module.exports = Flags;

+ 0
- 23
node_modules/cordova-plugin-file/www/LocalFileSystem.js Datei anzeigen

@@ -1,23 +0,0 @@
1
-/*
2
- *
3
- * Licensed to the Apache Software Foundation (ASF) under one
4
- * or more contributor license agreements.  See the NOTICE file
5
- * distributed with this work for additional information
6
- * regarding copyright ownership.  The ASF licenses this file
7
- * to you under the Apache License, Version 2.0 (the
8
- * "License"); you may not use this file except in compliance
9
- * with the License.  You may obtain a copy of the License at
10
- *
11
- *   http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing,
14
- * software distributed under the License is distributed on an
15
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
- * KIND, either express or implied.  See the License for the
17
- * specific language governing permissions and limitations
18
- * under the License.
19
- *
20
-*/
21
-
22
-exports.TEMPORARY = 0;
23
-exports.PERSISTENT = 1;

+ 0
- 40
node_modules/cordova-plugin-file/www/Metadata.js Datei anzeigen

@@ -1,40 +0,0 @@
1
-/*
2
- *
3
- * Licensed to the Apache Software Foundation (ASF) under one
4
- * or more contributor license agreements.  See the NOTICE file
5
- * distributed with this work for additional information
6
- * regarding copyright ownership.  The ASF licenses this file
7
- * to you under the Apache License, Version 2.0 (the
8
- * "License"); you may not use this file except in compliance
9
- * with the License.  You may obtain a copy of the License at
10
- *
11
- *   http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing,
14
- * software distributed under the License is distributed on an
15
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
- * KIND, either express or implied.  See the License for the
17
- * specific language governing permissions and limitations
18
- * under the License.
19
- *
20
-*/
21
-
22
-/**
23
- * Information about the state of the file or directory
24
- *
25
- * {Date} modificationTime (readonly)
26
- */
27
-var Metadata = function (metadata) {
28
-    if (typeof metadata === 'object') {
29
-        this.modificationTime = new Date(metadata.modificationTime);
30
-        this.size = metadata.size || 0;
31
-    } else if (typeof metadata === 'undefined') {
32
-        this.modificationTime = null;
33
-        this.size = 0;
34
-    } else {
35
-        /* Backwards compatiblity with platforms that only return a timestamp */
36
-        this.modificationTime = new Date(metadata);
37
-    }
38
-};
39
-
40
-module.exports = Metadata;

+ 0
- 67
node_modules/cordova-plugin-file/www/ProgressEvent.js Datei anzeigen

@@ -1,67 +0,0 @@
1
-/*
2
- *
3
- * Licensed to the Apache Software Foundation (ASF) under one
4
- * or more contributor license agreements.  See the NOTICE file
5
- * distributed with this work for additional information
6
- * regarding copyright ownership.  The ASF licenses this file
7
- * to you under the Apache License, Version 2.0 (the
8
- * "License"); you may not use this file except in compliance
9
- * with the License.  You may obtain a copy of the License at
10
- *
11
- *   http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing,
14
- * software distributed under the License is distributed on an
15
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
- * KIND, either express or implied.  See the License for the
17
- * specific language governing permissions and limitations
18
- * under the License.
19
- *
20
-*/
21
-
22
-// If ProgressEvent exists in global context, use it already, otherwise use our own polyfill
23
-// Feature test: See if we can instantiate a native ProgressEvent;
24
-// if so, use that approach,
25
-// otherwise fill-in with our own implementation.
26
-//
27
-// NOTE: right now we always fill in with our own. Down the road would be nice if we can use whatever is native in the webview.
28
-var ProgressEvent = (function () {
29
-    /*
30
-    var createEvent = function(data) {
31
-        var event = document.createEvent('Events');
32
-        event.initEvent('ProgressEvent', false, false);
33
-        if (data) {
34
-            for (var i in data) {
35
-                if (data.hasOwnProperty(i)) {
36
-                    event[i] = data[i];
37
-                }
38
-            }
39
-            if (data.target) {
40
-                // TODO: cannot call <some_custom_object>.dispatchEvent
41
-                // need to first figure out how to implement EventTarget
42
-            }
43
-        }
44
-        return event;
45
-    };
46
-    try {
47
-        var ev = createEvent({type:"abort",target:document});
48
-        return function ProgressEvent(type, data) {
49
-            data.type = type;
50
-            return createEvent(data);
51
-        };
52
-    } catch(e){
53
-    */
54
-    return function ProgressEvent (type, dict) {
55
-        this.type = type;
56
-        this.bubbles = false;
57
-        this.cancelBubble = false;
58
-        this.cancelable = false;
59
-        this.lengthComputable = false;
60
-        this.loaded = dict && dict.loaded ? dict.loaded : 0;
61
-        this.total = dict && dict.total ? dict.total : 0;
62
-        this.target = dict && dict.target ? dict.target : null;
63
-    };
64
-    // }
65
-})();
66
-
67
-module.exports = ProgressEvent;

+ 0
- 48
node_modules/cordova-plugin-file/www/android/FileSystem.js Datei anzeigen

@@ -1,48 +0,0 @@
1
-/*
2
- *
3
- * Licensed to the Apache Software Foundation (ASF) under one
4
- * or more contributor license agreements.  See the NOTICE file
5
- * distributed with this work for additional information
6
- * regarding copyright ownership.  The ASF licenses this file
7
- * to you under the Apache License, Version 2.0 (the
8
- * "License"); you may not use this file except in compliance
9
- * with the License.  You may obtain a copy of the License at
10
- *
11
- *   http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing,
14
- * software distributed under the License is distributed on an
15
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
- * KIND, either express or implied.  See the License for the
17
- * specific language governing permissions and limitations
18
- * under the License.
19
- *
20
-*/
21
-
22
-FILESYSTEM_PROTOCOL = 'cdvfile'; // eslint-disable-line no-undef
23
-
24
-module.exports = {
25
-    __format__: function (fullPath, nativeUrl) {
26
-        var path;
27
-        var contentUrlMatch = /^content:\/\//.exec(nativeUrl);
28
-        if (contentUrlMatch) {
29
-            // When available, use the path from a native content URL, which was already encoded by Android.
30
-            // This is necessary because JavaScript's encodeURI() does not encode as many characters as
31
-            // Android, which can result in permission exceptions when the encoding of a content URI
32
-            // doesn't match the string for which permission was originally granted.
33
-            path = nativeUrl.substring(contentUrlMatch[0].length - 1);
34
-        } else {
35
-            path = FileSystem.encodeURIPath(fullPath); // eslint-disable-line no-undef
36
-            if (!/^\//.test(path)) {
37
-                path = '/' + path;
38
-            }
39
-
40
-            var m = /\?.*/.exec(nativeUrl);
41
-            if (m) {
42
-                path += m[0];
43
-            }
44
-        }
45
-
46
-        return FILESYSTEM_PROTOCOL + '://localhost/' + this.name + path; // eslint-disable-line no-undef
47
-    }
48
-};

+ 0
- 30
node_modules/cordova-plugin-file/www/browser/FileSystem.js Datei anzeigen

@@ -1,30 +0,0 @@
1
-/*
2
- *
3
- * Licensed to the Apache Software Foundation (ASF) under one
4
- * or more contributor license agreements.  See the NOTICE file
5
- * distributed with this work for additional information
6
- * regarding copyright ownership.  The ASF licenses this file
7
- * to you under the Apache License, Version 2.0 (the
8
- * "License"); you may not use this file except in compliance
9
- * with the License.  You may obtain a copy of the License at
10
- *
11
- *   http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing,
14
- * software distributed under the License is distributed on an
15
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
- * KIND, either express or implied.  See the License for the
17
- * specific language governing permissions and limitations
18
- * under the License.
19
- *
20
-*/
21
-
22
-/* global FILESYSTEM_PREFIX: true, module */
23
-
24
-FILESYSTEM_PREFIX = 'file:///';
25
-
26
-module.exports = {
27
-    __format__: function (fullPath) {
28
-        return (FILESYSTEM_PREFIX + this.name + (fullPath[0] === '/' ? '' : '/') + FileSystem.encodeURIPath(fullPath)); // eslint-disable-line no-undef
29
-    }
30
-};

+ 0
- 192
node_modules/cordova-plugin-file/www/browser/Preparing.js Datei anzeigen

@@ -1,192 +0,0 @@
1
-/*
2
- *
3
- * Licensed to the Apache Software Foundation (ASF) under one
4
- * or more contributor license agreements.  See the NOTICE file
5
- * distributed with this work for additional information
6
- * regarding copyright ownership.  The ASF licenses this file
7
- * to you under the Apache License, Version 2.0 (the
8
- * "License"); you may not use this file except in compliance
9
- * with the License.  You may obtain a copy of the License at
10
- *
11
- *   http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing,
14
- * software distributed under the License is distributed on an
15
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
- * KIND, either express or implied.  See the License for the
17
- * specific language governing permissions and limitations
18
- * under the License.
19
- *
20
-*/
21
-
22
-(function () {
23
-    /* global require */
24
-
25
-    // Only Chrome uses this file.
26
-    if (!require('./isChrome')()) {
27
-        return;
28
-    }
29
-
30
-    var channel = require('cordova/channel');
31
-    var FileError = require('./FileError');
32
-    var PERSISTENT_FS_QUOTA = 5 * 1024 * 1024;
33
-    var filePluginIsReadyEvent = new Event('filePluginIsReady'); // eslint-disable-line no-undef
34
-
35
-    var entryFunctionsCreated = false;
36
-    var quotaWasRequested = false;
37
-    var eventWasThrown = false;
38
-
39
-    if (!window.requestFileSystem) {
40
-        window.requestFileSystem = function (type, size, win, fail) {
41
-            if (fail) {
42
-                fail('Not supported');
43
-            }
44
-        };
45
-    } else {
46
-        window.requestFileSystem(window.TEMPORARY, 1, createFileEntryFunctions, function () {});
47
-    }
48
-
49
-    if (!window.resolveLocalFileSystemURL) {
50
-        window.resolveLocalFileSystemURL = function (url, win, fail) {
51
-            if (fail) {
52
-                fail('Not supported');
53
-            }
54
-        };
55
-    }
56
-
57
-    // Resolves a filesystem entry by its path - which is passed either in standard (filesystem:file://) or
58
-    // Cordova-specific (cdvfile://) universal way.
59
-    // Aligns with specification: http://www.w3.org/TR/2011/WD-file-system-api-20110419/#widl-LocalFileSystem-resolveLocalFileSystemURL
60
-    var nativeResolveLocalFileSystemURL = window.resolveLocalFileSystemURL || window.webkitResolveLocalFileSystemURL;
61
-    window.resolveLocalFileSystemURL = function (url, win, fail) {
62
-        /* If url starts with `cdvfile` then we need convert it to Chrome real url first:
63
-          cdvfile://localhost/persistent/path/to/file -> filesystem:file://persistent/path/to/file */
64
-        if (url.trim().substr(0, 7) === 'cdvfile') {
65
-            /* Quirk:
66
-            Plugin supports cdvfile://localhost (local resources) only.
67
-            I.e. external resources are not supported via cdvfile. */
68
-            if (url.indexOf('cdvfile://localhost') !== -1) {
69
-                // Browser supports temporary and persistent only
70
-                var indexPersistent = url.indexOf('persistent');
71
-                var indexTemporary = url.indexOf('temporary');
72
-
73
-                /* Chrome urls start with 'filesystem:' prefix. See quirk:
74
-                   toURL function in Chrome returns filesystem:-prefixed path depending on application host.
75
-                   For example, filesystem:file:///persistent/somefile.txt,
76
-                   filesystem:http://localhost:8080/persistent/somefile.txt. */
77
-                var prefix = 'filesystem:file:///';
78
-                if (location.protocol !== 'file:') { // eslint-disable-line no-undef
79
-                    prefix = 'filesystem:' + location.origin + '/'; // eslint-disable-line no-undef
80
-                }
81
-
82
-                var result;
83
-                if (indexPersistent !== -1) {
84
-                    // cdvfile://localhost/persistent/path/to/file -> filesystem:file://persistent/path/to/file
85
-                    // or filesystem:http://localhost:8080/persistent/path/to/file
86
-                    result = prefix + 'persistent' + url.substr(indexPersistent + 10);
87
-                    nativeResolveLocalFileSystemURL(result, win, fail);
88
-                    return;
89
-                }
90
-
91
-                if (indexTemporary !== -1) {
92
-                    // cdvfile://localhost/temporary/path/to/file -> filesystem:file://temporary/path/to/file
93
-                    // or filesystem:http://localhost:8080/temporary/path/to/file
94
-                    result = prefix + 'temporary' + url.substr(indexTemporary + 9);
95
-                    nativeResolveLocalFileSystemURL(result, win, fail);
96
-                    return;
97
-                }
98
-            }
99
-
100
-            // cdvfile other than local file resource is not supported
101
-            if (fail) {
102
-                fail(new FileError(FileError.ENCODING_ERR));
103
-            }
104
-        } else {
105
-            nativeResolveLocalFileSystemURL(url, win, fail);
106
-        }
107
-    };
108
-
109
-    function createFileEntryFunctions (fs) {
110
-        fs.root.getFile('todelete_658674_833_4_cdv', {create: true}, function (fileEntry) {
111
-            var fileEntryType = Object.getPrototypeOf(fileEntry);
112
-            var entryType = Object.getPrototypeOf(fileEntryType);
113
-
114
-            // Save the original method
115
-            var origToURL = entryType.toURL;
116
-            entryType.toURL = function () {
117
-                var origURL = origToURL.call(this);
118
-                if (this.isDirectory && origURL.substr(-1) !== '/') {
119
-                    return origURL + '/';
120
-                }
121
-                return origURL;
122
-            };
123
-
124
-            entryType.toNativeURL = function () {
125
-                console.warn("DEPRECATED: Update your code to use 'toURL'");
126
-                return this.toURL();
127
-            };
128
-
129
-            entryType.toInternalURL = function () {
130
-                if (this.toURL().indexOf('persistent') > -1) {
131
-                    return 'cdvfile://localhost/persistent' + this.fullPath;
132
-                }
133
-
134
-                if (this.toURL().indexOf('temporary') > -1) {
135
-                    return 'cdvfile://localhost/temporary' + this.fullPath;
136
-                }
137
-            };
138
-
139
-            entryType.setMetadata = function (win, fail /*, metadata */) {
140
-                if (fail) {
141
-                    fail('Not supported');
142
-                }
143
-            };
144
-
145
-            fileEntry.createWriter(function (writer) {
146
-                var originalWrite = writer.write;
147
-                var writerProto = Object.getPrototypeOf(writer);
148
-                writerProto.write = function (blob) {
149
-                    if (blob instanceof Blob) { // eslint-disable-line no-undef
150
-                        originalWrite.apply(this, [blob]);
151
-                    } else {
152
-                        var realBlob = new Blob([blob]); // eslint-disable-line no-undef
153
-                        originalWrite.apply(this, [realBlob]);
154
-                    }
155
-                };
156
-
157
-                fileEntry.remove(function () { entryFunctionsCreated = true; }, function () { /* empty callback */ });
158
-            });
159
-        });
160
-    }
161
-
162
-    window.initPersistentFileSystem = function (size, win, fail) {
163
-        if (navigator.webkitPersistentStorage) {
164
-            navigator.webkitPersistentStorage.requestQuota(size, win, fail);
165
-            return;
166
-        }
167
-
168
-        fail('This browser does not support this function');
169
-    };
170
-
171
-    window.isFilePluginReadyRaised = function () { return eventWasThrown; };
172
-
173
-    window.initPersistentFileSystem(PERSISTENT_FS_QUOTA, function () {
174
-        console.log('Persistent fs quota granted');
175
-        quotaWasRequested = true;
176
-    }, function (e) {
177
-        console.log('Error occured while trying to request Persistent fs quota: ' + JSON.stringify(e));
178
-    });
179
-
180
-    channel.onCordovaReady.subscribe(function () {
181
-        function dispatchEventIfReady () {
182
-            if (entryFunctionsCreated && quotaWasRequested) {
183
-                window.dispatchEvent(filePluginIsReadyEvent);
184
-                eventWasThrown = true;
185
-            } else {
186
-                setTimeout(dispatchEventIfReady, 100);
187
-            }
188
-        }
189
-
190
-        dispatchEventIfReady();
191
-    }, false);
192
-})();

+ 0
- 26
node_modules/cordova-plugin-file/www/browser/isChrome.js Datei anzeigen

@@ -1,26 +0,0 @@
1
-/*
2
- *
3
- * Licensed to the Apache Software Foundation (ASF) under one
4
- * or more contributor license agreements.  See the NOTICE file
5
- * distributed with this work for additional information
6
- * regarding copyright ownership.  The ASF licenses this file
7
- * to you under the Apache License, Version 2.0 (the
8
- * "License"); you may not use this file except in compliance
9
- * with the License.  You may obtain a copy of the License at
10
- *
11
- *   http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing,
14
- * software distributed under the License is distributed on an
15
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
- * KIND, either express or implied.  See the License for the
17
- * specific language governing permissions and limitations
18
- * under the License.
19
- *
20
- */
21
-
22
-module.exports = function () {
23
-    // window.webkitRequestFileSystem and window.webkitResolveLocalFileSystemURL are available only in Chrome and
24
-    // possibly a good flag to indicate that we're running in Chrome
25
-    return window.webkitRequestFileSystem && window.webkitResolveLocalFileSystemURL;
26
-};

+ 0
- 62
node_modules/cordova-plugin-file/www/fileSystemPaths.js Datei anzeigen

@@ -1,62 +0,0 @@
1
-/*
2
- *
3
- * Licensed to the Apache Software Foundation (ASF) under one
4
- * or more contributor license agreements.  See the NOTICE file
5
- * distributed with this work for additional information
6
- * regarding copyright ownership.  The ASF licenses this file
7
- * to you under the Apache License, Version 2.0 (the
8
- * "License"); you may not use this file except in compliance
9
- * with the License.  You may obtain a copy of the License at
10
- *
11
- *   http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing,
14
- * software distributed under the License is distributed on an
15
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
- * KIND, either express or implied.  See the License for the
17
- * specific language governing permissions and limitations
18
- * under the License.
19
- *
20
-*/
21
-
22
-var exec = require('cordova/exec');
23
-var channel = require('cordova/channel');
24
-
25
-exports.file = {
26
-    // Read-only directory where the application is installed.
27
-    applicationDirectory: null,
28
-    // Root of app's private writable storage
29
-    applicationStorageDirectory: null,
30
-    // Where to put app-specific data files.
31
-    dataDirectory: null,
32
-    // Cached files that should survive app restarts.
33
-    // Apps should not rely on the OS to delete files in here.
34
-    cacheDirectory: null,
35
-    // Android: the application space on external storage.
36
-    externalApplicationStorageDirectory: null,
37
-    // Android: Where to put app-specific data files on external storage.
38
-    externalDataDirectory: null,
39
-    // Android: the application cache on external storage.
40
-    externalCacheDirectory: null,
41
-    // Android: the external storage (SD card) root.
42
-    externalRootDirectory: null,
43
-    // iOS: Temp directory that the OS can clear at will.
44
-    tempDirectory: null,
45
-    // iOS: Holds app-specific files that should be synced (e.g. to iCloud).
46
-    syncedDataDirectory: null,
47
-    // iOS: Files private to the app, but that are meaningful to other applications (e.g. Office files)
48
-    documentsDirectory: null,
49
-    // BlackBerry10: Files globally available to all apps
50
-    sharedDirectory: null
51
-};
52
-
53
-channel.waitForInitialization('onFileSystemPathsReady');
54
-channel.onCordovaReady.subscribe(function () {
55
-    function after (paths) {
56
-        for (var k in paths) {
57
-            exports.file[k] = paths[k];
58
-        }
59
-        channel.initializationComplete('onFileSystemPathsReady');
60
-    }
61
-    exec(after, null, 'File', 'requestAllPaths', []);
62
-});

+ 0
- 46
node_modules/cordova-plugin-file/www/fileSystems-roots.js Datei anzeigen

@@ -1,46 +0,0 @@
1
-/*
2
- *
3
- * Licensed to the Apache Software Foundation (ASF) under one
4
- * or more contributor license agreements.  See the NOTICE file
5
- * distributed with this work for additional information
6
- * regarding copyright ownership.  The ASF licenses this file
7
- * to you under the Apache License, Version 2.0 (the
8
- * "License"); you may not use this file except in compliance
9
- * with the License.  You may obtain a copy of the License at
10
- *
11
- *   http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing,
14
- * software distributed under the License is distributed on an
15
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
- * KIND, either express or implied.  See the License for the
17
- * specific language governing permissions and limitations
18
- * under the License.
19
- *
20
-*/
21
-
22
-// Map of fsName -> FileSystem.
23
-var fsMap = null;
24
-var FileSystem = require('./FileSystem');
25
-var exec = require('cordova/exec');
26
-
27
-// Overridden by Android, BlackBerry 10 and iOS to populate fsMap.
28
-require('./fileSystems').getFs = function (name, callback) {
29
-    function success (response) {
30
-        fsMap = {};
31
-        for (var i = 0; i < response.length; ++i) {
32
-            var fsRoot = response[i];
33
-            if (fsRoot) {
34
-                var fs = new FileSystem(fsRoot.filesystemName, fsRoot);
35
-                fsMap[fs.name] = fs;
36
-            }
37
-        }
38
-        callback(fsMap[name]);
39
-    }
40
-
41
-    if (fsMap) {
42
-        callback(fsMap[name]);
43
-    } else {
44
-        exec(success, null, 'File', 'requestAllFileSystems', []);
45
-    }
46
-};

+ 0
- 25
node_modules/cordova-plugin-file/www/fileSystems.js Datei anzeigen

@@ -1,25 +0,0 @@
1
-/*
2
- *
3
- * Licensed to the Apache Software Foundation (ASF) under one
4
- * or more contributor license agreements.  See the NOTICE file
5
- * distributed with this work for additional information
6
- * regarding copyright ownership.  The ASF licenses this file
7
- * to you under the Apache License, Version 2.0 (the
8
- * "License"); you may not use this file except in compliance
9
- * with the License.  You may obtain a copy of the License at
10
- *
11
- *   http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing,
14
- * software distributed under the License is distributed on an
15
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
- * KIND, either express or implied.  See the License for the
17
- * specific language governing permissions and limitations
18
- * under the License.
19
- *
20
-*/
21
-
22
-// Overridden by Android, BlackBerry 10 and iOS to populate fsMap.
23
-module.exports.getFs = function (name, callback) {
24
-    callback(null);
25
-};

+ 0
- 29
node_modules/cordova-plugin-file/www/ios/FileSystem.js Datei anzeigen

@@ -1,29 +0,0 @@
1
-/*
2
- *
3
- * Licensed to the Apache Software Foundation (ASF) under one
4
- * or more contributor license agreements.  See the NOTICE file
5
- * distributed with this work for additional information
6
- * regarding copyright ownership.  The ASF licenses this file
7
- * to you under the Apache License, Version 2.0 (the
8
- * "License"); you may not use this file except in compliance
9
- * with the License.  You may obtain a copy of the License at
10
- *
11
- *   http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing,
14
- * software distributed under the License is distributed on an
15
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
- * KIND, either express or implied.  See the License for the
17
- * specific language governing permissions and limitations
18
- * under the License.
19
- *
20
-*/
21
-/* eslint no-undef : 0 */
22
-FILESYSTEM_PROTOCOL = 'cdvfile';
23
-
24
-module.exports = {
25
-    __format__: function (fullPath) {
26
-        var path = ('/' + this.name + (fullPath[0] === '/' ? '' : '/') + FileSystem.encodeURIPath(fullPath)).replace('//', '/');
27
-        return FILESYSTEM_PROTOCOL + '://localhost' + path;
28
-    }
29
-};

+ 0
- 29
node_modules/cordova-plugin-file/www/osx/FileSystem.js Datei anzeigen

@@ -1,29 +0,0 @@
1
-/*
2
- *
3
- * Licensed to the Apache Software Foundation (ASF) under one
4
- * or more contributor license agreements.  See the NOTICE file
5
- * distributed with this work for additional information
6
- * regarding copyright ownership.  The ASF licenses this file
7
- * to you under the Apache License, Version 2.0 (the
8
- * "License"); you may not use this file except in compliance
9
- * with the License.  You may obtain a copy of the License at
10
- *
11
- *   http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing,
14
- * software distributed under the License is distributed on an
15
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
- * KIND, either express or implied.  See the License for the
17
- * specific language governing permissions and limitations
18
- * under the License.
19
- *
20
-*/
21
-/* eslint no-undef : 0 */
22
-FILESYSTEM_PROTOCOL = 'cdvfile';
23
-
24
-module.exports = {
25
-    __format__: function (fullPath) {
26
-        var path = ('/' + this.name + (fullPath[0] === '/' ? '' : '/') + FileSystem.encodeURIPath(fullPath)).replace('//', '/');
27
-        return FILESYSTEM_PROTOCOL + '://localhost' + path;
28
-    }
29
-};

+ 0
- 81
node_modules/cordova-plugin-file/www/requestFileSystem.js Datei anzeigen

@@ -1,81 +0,0 @@
1
-/*
2
- *
3
- * Licensed to the Apache Software Foundation (ASF) under one
4
- * or more contributor license agreements.  See the NOTICE file
5
- * distributed with this work for additional information
6
- * regarding copyright ownership.  The ASF licenses this file
7
- * to you under the Apache License, Version 2.0 (the
8
- * "License"); you may not use this file except in compliance
9
- * with the License.  You may obtain a copy of the License at
10
- *
11
- *   http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing,
14
- * software distributed under the License is distributed on an
15
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
- * KIND, either express or implied.  See the License for the
17
- * specific language governing permissions and limitations
18
- * under the License.
19
- *
20
-*/
21
-
22
-(function () {
23
-    // For browser platform: not all browsers use this file.
24
-    function checkBrowser () {
25
-        if (cordova.platformId === 'browser' && require('./isChrome')()) { // eslint-disable-line no-undef
26
-            module.exports = window.requestFileSystem || window.webkitRequestFileSystem;
27
-            return true;
28
-        }
29
-        return false;
30
-    }
31
-    if (checkBrowser()) {
32
-        return;
33
-    }
34
-
35
-    var argscheck = require('cordova/argscheck');
36
-    var FileError = require('./FileError');
37
-    var FileSystem = require('./FileSystem');
38
-    var exec = require('cordova/exec');
39
-    var fileSystems = require('./fileSystems');
40
-
41
-    /**
42
-     * Request a file system in which to store application data.
43
-     * @param type  local file system type
44
-     * @param size  indicates how much storage space, in bytes, the application expects to need
45
-     * @param successCallback  invoked with a FileSystem object
46
-     * @param errorCallback  invoked if error occurs retrieving file system
47
-     */
48
-    var requestFileSystem = function (type, size, successCallback, errorCallback) {
49
-        argscheck.checkArgs('nnFF', 'requestFileSystem', arguments);
50
-        var fail = function (code) {
51
-            if (errorCallback) {
52
-                errorCallback(new FileError(code));
53
-            }
54
-        };
55
-
56
-        if (type < 0) {
57
-            fail(FileError.SYNTAX_ERR);
58
-        } else {
59
-            // if successful, return a FileSystem object
60
-            var success = function (file_system) {
61
-                if (file_system) {
62
-                    if (successCallback) {
63
-                        fileSystems.getFs(file_system.name, function (fs) {
64
-                            // This should happen only on platforms that haven't implemented requestAllFileSystems (windows)
65
-                            if (!fs) {
66
-                                fs = new FileSystem(file_system.name, file_system.root);
67
-                            }
68
-                            successCallback(fs);
69
-                        });
70
-                    }
71
-                } else {
72
-                    // no FileSystem object returned
73
-                    fail(FileError.NOT_FOUND_ERR);
74
-                }
75
-            };
76
-            exec(success, fail, 'File', 'requestFileSystem', [type, size]);
77
-        }
78
-    };
79
-
80
-    module.exports = requestFileSystem;
81
-})();

+ 0
- 91
node_modules/cordova-plugin-file/www/resolveLocalFileSystemURI.js Datei anzeigen

@@ -1,91 +0,0 @@
1
-/*
2
- *
3
- * Licensed to the Apache Software Foundation (ASF) under one
4
- * or more contributor license agreements.  See the NOTICE file
5
- * distributed with this work for additional information
6
- * regarding copyright ownership.  The ASF licenses this file
7
- * to you under the Apache License, Version 2.0 (the
8
- * "License"); you may not use this file except in compliance
9
- * with the License.  You may obtain a copy of the License at
10
- *
11
- *   http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing,
14
- * software distributed under the License is distributed on an
15
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
- * KIND, either express or implied.  See the License for the
17
- * specific language governing permissions and limitations
18
- * under the License.
19
- *
20
-*/
21
-(function () {
22
-    // For browser platform: not all browsers use overrided `resolveLocalFileSystemURL`.
23
-    function checkBrowser () {
24
-        if (cordova.platformId === 'browser' && require('./isChrome')()) { // eslint-disable-line no-undef
25
-            module.exports.resolveLocalFileSystemURL = window.resolveLocalFileSystemURL || window.webkitResolveLocalFileSystemURL;
26
-            return true;
27
-        }
28
-        return false;
29
-    }
30
-    if (checkBrowser()) {
31
-        return;
32
-    }
33
-
34
-    var argscheck = require('cordova/argscheck');
35
-    var DirectoryEntry = require('./DirectoryEntry');
36
-    var FileEntry = require('./FileEntry');
37
-    var FileError = require('./FileError');
38
-    var exec = require('cordova/exec');
39
-    var fileSystems = require('./fileSystems');
40
-
41
-    /**
42
-     * Look up file system Entry referred to by local URI.
43
-     * @param {DOMString} uri  URI referring to a local file or directory
44
-     * @param successCallback  invoked with Entry object corresponding to URI
45
-     * @param errorCallback    invoked if error occurs retrieving file system entry
46
-     */
47
-    module.exports.resolveLocalFileSystemURL = module.exports.resolveLocalFileSystemURL || function (uri, successCallback, errorCallback) {
48
-        argscheck.checkArgs('sFF', 'resolveLocalFileSystemURI', arguments);
49
-        // error callback
50
-        var fail = function (error) {
51
-            if (errorCallback) {
52
-                errorCallback(new FileError(error));
53
-            }
54
-        };
55
-        // sanity check for 'not:valid:filename' or '/not:valid:filename'
56
-        // file.spec.12 window.resolveLocalFileSystemURI should error (ENCODING_ERR) when resolving invalid URI with leading /.
57
-        if (!uri || uri.split(':').length > 2) {
58
-            setTimeout(function () {
59
-                fail(FileError.ENCODING_ERR);
60
-            }, 0);
61
-            return;
62
-        }
63
-        // if successful, return either a file or directory entry
64
-        var success = function (entry) {
65
-            if (entry) {
66
-                if (successCallback) {
67
-                    // create appropriate Entry object
68
-                    var fsName = entry.filesystemName || (entry.filesystem && entry.filesystem.name) || (entry.filesystem === window.PERSISTENT ? 'persistent' : 'temporary'); // eslint-disable-line no-undef
69
-                    fileSystems.getFs(fsName, function (fs) {
70
-                        // This should happen only on platforms that haven't implemented requestAllFileSystems (windows)
71
-                        if (!fs) {
72
-                            fs = new FileSystem(fsName, {name: '', fullPath: '/'}); // eslint-disable-line no-undef
73
-                        }
74
-                        var result = (entry.isDirectory) ? new DirectoryEntry(entry.name, entry.fullPath, fs, entry.nativeURL) : new FileEntry(entry.name, entry.fullPath, fs, entry.nativeURL);
75
-                        successCallback(result);
76
-                    });
77
-                }
78
-            } else {
79
-                // no Entry object returned
80
-                fail(FileError.NOT_FOUND_ERR);
81
-            }
82
-        };
83
-
84
-        exec(success, fail, 'File', 'resolveLocalFileSystemURI', [uri]);
85
-    };
86
-
87
-    module.exports.resolveLocalFileSystemURI = function () {
88
-        console.log('resolveLocalFileSystemURI is deprecated. Please call resolveLocalFileSystemURL instead.');
89
-        module.exports.resolveLocalFileSystemURL.apply(this, arguments);
90
-    };
91
-})();

+ 0
- 18
node_modules/cordova-plugin-nativestorage/.jshintrc Datei anzeigen

@@ -1,18 +0,0 @@
1
-{
2
-    "browser": true,
3
-    "devel": true,
4
-    "undef": true,
5
-    "trailing": true,
6
-    "quotmark": false,
7
-    "indent": 4,
8
-    "unused": "vars",
9
-    "latedef": "nofunc",
10
-    "esversion": 6,
11
-    "globals": {
12
-        "module": false,
13
-        "exports": false,
14
-        "require": false,
15
-        "cordova": true,
16
-        "jasmineRequire": false
17
-    }
18
-}

+ 0
- 4
node_modules/cordova-plugin-nativestorage/.travis.yml Datei anzeigen

@@ -1,4 +0,0 @@
1
-language: node_js
2
-sudo: false
3
-node_js:
4
-  - "4.2"

+ 0
- 201
node_modules/cordova-plugin-nativestorage/LICENSE.md Datei anzeigen

@@ -1,201 +0,0 @@
1
-                                 Apache License
2
-                           Version 2.0, January 2004
3
-                        http://www.apache.org/licenses/
4
-
5
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
-
7
-   1. Definitions.
8
-
9
-      "License" shall mean the terms and conditions for use, reproduction,
10
-      and distribution as defined by Sections 1 through 9 of this document.
11
-
12
-      "Licensor" shall mean the copyright owner or entity authorized by
13
-      the copyright owner that is granting the License.
14
-
15
-      "Legal Entity" shall mean the union of the acting entity and all
16
-      other entities that control, are controlled by, or are under common
17
-      control with that entity. For the purposes of this definition,
18
-      "control" means (i) the power, direct or indirect, to cause the
19
-      direction or management of such entity, whether by contract or
20
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
-      outstanding shares, or (iii) beneficial ownership of such entity.
22
-
23
-      "You" (or "Your") shall mean an individual or Legal Entity
24
-      exercising permissions granted by this License.
25
-
26
-      "Source" form shall mean the preferred form for making modifications,
27
-      including but not limited to software source code, documentation
28
-      source, and configuration files.
29
-
30
-      "Object" form shall mean any form resulting from mechanical
31
-      transformation or translation of a Source form, including but
32
-      not limited to compiled object code, generated documentation,
33
-      and conversions to other media types.
34
-
35
-      "Work" shall mean the work of authorship, whether in Source or
36
-      Object form, made available under the License, as indicated by a
37
-      copyright notice that is included in or attached to the work
38
-      (an example is provided in the Appendix below).
39
-
40
-      "Derivative Works" shall mean any work, whether in Source or Object
41
-      form, that is based on (or derived from) the Work and for which the
42
-      editorial revisions, annotations, elaborations, or other modifications
43
-      represent, as a whole, an original work of authorship. For the purposes
44
-      of this License, Derivative Works shall not include works that remain
45
-      separable from, or merely link (or bind by name) to the interfaces of,
46
-      the Work and Derivative Works thereof.
47
-
48
-      "Contribution" shall mean any work of authorship, including
49
-      the original version of the Work and any modifications or additions
50
-      to that Work or Derivative Works thereof, that is intentionally
51
-      submitted to Licensor for inclusion in the Work by the copyright owner
52
-      or by an individual or Legal Entity authorized to submit on behalf of
53
-      the copyright owner. For the purposes of this definition, "submitted"
54
-      means any form of electronic, verbal, or written communication sent
55
-      to the Licensor or its representatives, including but not limited to
56
-      communication on electronic mailing lists, source code control systems,
57
-      and issue tracking systems that are managed by, or on behalf of, the
58
-      Licensor for the purpose of discussing and improving the Work, but
59
-      excluding communication that is conspicuously marked or otherwise
60
-      designated in writing by the copyright owner as "Not a Contribution."
61
-
62
-      "Contributor" shall mean Licensor and any individual or Legal Entity
63
-      on behalf of whom a Contribution has been received by Licensor and
64
-      subsequently incorporated within the Work.
65
-
66
-   2. Grant of Copyright License. Subject to the terms and conditions of
67
-      this License, each Contributor hereby grants to You a perpetual,
68
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
-      copyright license to reproduce, prepare Derivative Works of,
70
-      publicly display, publicly perform, sublicense, and distribute the
71
-      Work and such Derivative Works in Source or Object form.
72
-
73
-   3. Grant of Patent License. Subject to the terms and conditions of
74
-      this License, each Contributor hereby grants to You a perpetual,
75
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
-      (except as stated in this section) patent license to make, have made,
77
-      use, offer to sell, sell, import, and otherwise transfer the Work,
78
-      where such license applies only to those patent claims licensable
79
-      by such Contributor that are necessarily infringed by their
80
-      Contribution(s) alone or by combination of their Contribution(s)
81
-      with the Work to which such Contribution(s) was submitted. If You
82
-      institute patent litigation against any entity (including a
83
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
84
-      or a Contribution incorporated within the Work constitutes direct
85
-      or contributory patent infringement, then any patent licenses
86
-      granted to You under this License for that Work shall terminate
87
-      as of the date such litigation is filed.
88
-
89
-   4. Redistribution. You may reproduce and distribute copies of the
90
-      Work or Derivative Works thereof in any medium, with or without
91
-      modifications, and in Source or Object form, provided that You
92
-      meet the following conditions:
93
-
94
-      (a) You must give any other recipients of the Work or
95
-          Derivative Works a copy of this License; and
96
-
97
-      (b) You must cause any modified files to carry prominent notices
98
-          stating that You changed the files; and
99
-
100
-      (c) You must retain, in the Source form of any Derivative Works
101
-          that You distribute, all copyright, patent, trademark, and
102
-          attribution notices from the Source form of the Work,
103
-          excluding those notices that do not pertain to any part of
104
-          the Derivative Works; and
105
-
106
-      (d) If the Work includes a "NOTICE" text file as part of its
107
-          distribution, then any Derivative Works that You distribute must
108
-          include a readable copy of the attribution notices contained
109
-          within such NOTICE file, excluding those notices that do not
110
-          pertain to any part of the Derivative Works, in at least one
111
-          of the following places: within a NOTICE text file distributed
112
-          as part of the Derivative Works; within the Source form or
113
-          documentation, if provided along with the Derivative Works; or,
114
-          within a display generated by the Derivative Works, if and
115
-          wherever such third-party notices normally appear. The contents
116
-          of the NOTICE file are for informational purposes only and
117
-          do not modify the License. You may add Your own attribution
118
-          notices within Derivative Works that You distribute, alongside
119
-          or as an addendum to the NOTICE text from the Work, provided
120
-          that such additional attribution notices cannot be construed
121
-          as modifying the License.
122
-
123
-      You may add Your own copyright statement to Your modifications and
124
-      may provide additional or different license terms and conditions
125
-      for use, reproduction, or distribution of Your modifications, or
126
-      for any such Derivative Works as a whole, provided Your use,
127
-      reproduction, and distribution of the Work otherwise complies with
128
-      the conditions stated in this License.
129
-
130
-   5. Submission of Contributions. Unless You explicitly state otherwise,
131
-      any Contribution intentionally submitted for inclusion in the Work
132
-      by You to the Licensor shall be under the terms and conditions of
133
-      this License, without any additional terms or conditions.
134
-      Notwithstanding the above, nothing herein shall supersede or modify
135
-      the terms of any separate license agreement you may have executed
136
-      with Licensor regarding such Contributions.
137
-
138
-   6. Trademarks. This License does not grant permission to use the trade
139
-      names, trademarks, service marks, or product names of the Licensor,
140
-      except as required for reasonable and customary use in describing the
141
-      origin of the Work and reproducing the content of the NOTICE file.
142
-
143
-   7. Disclaimer of Warranty. Unless required by applicable law or
144
-      agreed to in writing, Licensor provides the Work (and each
145
-      Contributor provides its Contributions) on an "AS IS" BASIS,
146
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
-      implied, including, without limitation, any warranties or conditions
148
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
-      PARTICULAR PURPOSE. You are solely responsible for determining the
150
-      appropriateness of using or redistributing the Work and assume any
151
-      risks associated with Your exercise of permissions under this License.
152
-
153
-   8. Limitation of Liability. In no event and under no legal theory,
154
-      whether in tort (including negligence), contract, or otherwise,
155
-      unless required by applicable law (such as deliberate and grossly
156
-      negligent acts) or agreed to in writing, shall any Contributor be
157
-      liable to You for damages, including any direct, indirect, special,
158
-      incidental, or consequential damages of any character arising as a
159
-      result of this License or out of the use or inability to use the
160
-      Work (including but not limited to damages for loss of goodwill,
161
-      work stoppage, computer failure or malfunction, or any and all
162
-      other commercial damages or losses), even if such Contributor
163
-      has been advised of the possibility of such damages.
164
-
165
-   9. Accepting Warranty or Additional Liability. While redistributing
166
-      the Work or Derivative Works thereof, You may choose to offer,
167
-      and charge a fee for, acceptance of support, warranty, indemnity,
168
-      or other liability obligations and/or rights consistent with this
169
-      License. However, in accepting such obligations, You may act only
170
-      on Your own behalf and on Your sole responsibility, not on behalf
171
-      of any other Contributor, and only if You agree to indemnify,
172
-      defend, and hold each Contributor harmless for any liability
173
-      incurred by, or claims asserted against, such Contributor by reason
174
-      of your accepting any such warranty or additional liability.
175
-
176
-   END OF TERMS AND CONDITIONS
177
-
178
-   APPENDIX: How to apply the Apache License to your work.
179
-
180
-      To apply the Apache License to your work, attach the following
181
-      boilerplate notice, with the fields enclosed by brackets "{}"
182
-      replaced with your own identifying information. (Don't include
183
-      the brackets!)  The text should be enclosed in the appropriate
184
-      comment syntax for the file format. We also recommend that a
185
-      file or class name and description of purpose be included on the
186
-      same "printed page" as the copyright notice for easier
187
-      identification within third-party archives.
188
-
189
-   Copyright {yyyy} {name of copyright owner}
190
-
191
-   Licensed under the Apache License, Version 2.0 (the "License");
192
-   you may not use this file except in compliance with the License.
193
-   You may obtain a copy of the License at
194
-
195
-       http://www.apache.org/licenses/LICENSE-2.0
196
-
197
-   Unless required by applicable law or agreed to in writing, software
198
-   distributed under the License is distributed on an "AS IS" BASIS,
199
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
-   See the License for the specific language governing permissions and
201
-   limitations under the License.

+ 0
- 340
node_modules/cordova-plugin-nativestorage/README.md Datei anzeigen

@@ -1,340 +0,0 @@
1
-# Cordova plugin NativeStorage
2
-
3
-[![npm version](https://badge.fury.io/js/cordova-plugin-nativestorage.svg)](https://badge.fury.io/js/cordova-plugin-nativestorage) [![Build Status](https://travis-ci.org/TheCocoaProject/cordova-plugin-nativestorage.svg?branch=master)](https://travis-ci.org/TheCocoaProject/cordova-plugin-nativestorage)  [![Known Vulnerabilities](https://snyk.io/test/npm/cordova-plugin-nativestorage/badge.svg)](https://snyk.io/test/npm/cordova-plugin-nativestorage)
4
-
5
-
6
-[![NPM](https://nodei.co/npm/cordova-plugin-nativestorage.png?downloads=true&downloadRank=true)](https://nodei.co/npm/cordova-plugin-nativestorage/)
7
-
8
-Join the chat for questions and updates [![Join the chat at https://gitter.im/TheCocoaProject/cordova-plugin-nativestorage](https://badges.gitter.im/TheCocoaProject/cordova-plugin-nativestorage.svg)](https://gitter.im/TheCocoaProject/cordova-plugin-nativestorage?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
9
-
10
-*** 
11
-
12
-Cite this plugin:
13
-```latex
14
-@misc{callebautNS,
15
-author =   {Gilles Callebaut and Alok Rajiv},
16
-title =    {{NativeStorage - A Cordova Plugin}},
17
-howpublished = {\url{https://github.com/TheCocoaProject/cordova-plugin-nativestorage}},
18
-}
19
-```
20
-
21
-You can also provide a `version` field to include a version number e.g., `version = {2.3.1}`.
22
-
23
-***
24
-
25
-#### :) As per [npm-stat](https://npm-stat.com/charts.html?package=cordova-plugin-nativestorage&from=2016-04-01) we just crossed 150k downloads!! Thanks to everyone who helped and to everyone who have send in their kind words!
26
-
27
-NEW: Windows and OS X is supported!
28
-UPDATE: The Plugin can now also be found at the [Telerik Plugin Market](http://plugins.telerik.com/cordova/plugin/nativestorage).
29
-
30
-Documentation about the API prior to v2 can be found at the [wiki](https://github.com/TheCocoaProject/cordova-plugin-nativestorage/wiki/Usage-API-(prior-to-v2.0.0))
31
-***
32
-
33
-The plugin was created and developed by [Gilles Callebaut](https://be.linkedin.com/in/gilles-callebaut-46a751104), in the scope of an [IWT/VlAIO](http://www.vlaio.be/english) Tetra project [CrossMoS](https://www.msec.be/crossmos/) which assesses Mobile Cross-Platform Tools. This wouldn't be possible without the contributions of [Alok Rajiv](https://github.com/alokrajiv), our Cordova and JavaScript guru.
34
-
35
-Please consider reading our [wiki](https://github.com/TheCocoaProject/cordova-plugin-nativestorage/wiki) for more documentation about this plugin.
36
-
37
-## Contents
38
-- [Why the need for this plugin?](#why)
39
-	* [When to use the plugin](#when)
40
-- [Scientific articles](#articles)
41
-- [Installation](#installation)
42
-- [Supported Platforms](#supported_platforms)
43
-- [Supported Frameworks](#supported_frameworks)
44
-- [Usage](#usage)
45
-	* [Supported data types](#supported_data_types)
46
-	* [Storing values](#storing_values)
47
-	* [Retrieving values](#retrieving_values)
48
-	* [Retrieving all keys](#retrieving_keys)
49
-	* [Removing values](#removing_values)
50
-	* [Demo Example](#demo_example)
51
-- [Security](#security)
52
-- [Errors](#errors)
53
-- [Problems](#problems)
54
-- [F.A.Q](#FAQ)
55
-- [Applications using this plugin](#applications)
56
-
57
-
58
-## <a name="why"></a>Why?
59
-This plugin is created because of the non-persistent property of LocalStorage in the WebView of Android and iOS.
60
-In iOS stored data from LocalStorage can be removed by the OS, when running out of memory.
61
-
62
-Some complaints:
63
-- http://gonehybrid.com/dont-assume-localstorage-will-always-work-in-your-hybrid-app/
64
-- http://stackoverflow.com/questions/7750857/how-permanent-is-local-storage-on-android-and-ios
65
-- http://stackoverflow.com/questions/25627991/ios-7-webview-and-localstorage-persistence-update
66
-- http://stackoverflow.com/questions/28082624/localstorage-persistence-in-ios-android-webview
67
-- https://forum.ionicframework.com/t/localstorage-is-it-cleared-after-app-restarts-periodically-in-ios/21819
68
-- https://bugs.chromium.org/p/chromium/issues/detail?id=481380
69
-- From Cordova itself: http://cordova.apache.org/docs/en/latest/cordova/storage/storage.html
70
-
71
-### <a name="when"></a>When to use the plugin
72
-- **Simple**: Uniform and convenient way of organizing, storing, and accessing the data
73
-- **Fast**: Less than 1 milisecond to save or retrieve an object (in general)
74
-- **Persistence**: Save data over multiple sessions, i.e. holds the data till the application is removed from the device
75
-- **Small data**: Store small amounts of persistent data (less than a few hundred kilobytes)
76
-	* It is possible to store more than a few megabytes, but that's not the intended usage of the plugin.
77
-	* See issue [#31](https://github.com/TheCocoaProject/cordova-plugin-nativestorage/issues/31) for a more 'in-depth' explanation of size limit.
78
-
79
-#### Examples
80
-Storage of:
81
-- User preferences
82
-- Game progress
83
-- Text
84
-- ...
85
-
86
-### When not to use the plugin
87
-- Storing and retrieving files can be done by means of the [file plugin](https://github.com/apache/cordova-plugin-file)
88
-- For storing many objects please consider trying a database-based strategy, for instance: WebSQL and [SQLite plugin](https://github.com/litehelpers/Cordova-sqlite-storage).
89
-
90
-
91
-## <a name="articles"></a>Scientific Articles
92
-[Assessment of Data Storage Strategies Using the Mobile Cross-Platform Tool Cordova](https://thinkmind.org/download.php?articleid=mobility_2017_2_10_90007)
93
-
94
-## <a name="installation"></a>Installation
95
-The plugin can be installed via the Cordova command line interface:
96
-* Navigate to the root folder for your Cordova/Phonegap/Ionic project.
97
-* Run the command:
98
-```sh
99
-cordova plugin add cordova-plugin-nativestorage
100
-```
101
-or through this git repo if you want to be running the development version:
102
-```sh
103
-cordova plugin add https://github.com/TheCocoaProject/cordova-plugin-nativestorage
104
-```
105
-
106
-If you're using ngCordova you can use the ngCordova-wrapper:
107
-```sh
108
-bower install git://github.com/TheCocoaProject/ngcordova-wrapper-nativestorage --save-dev
109
-```
110
-For more information about the usage of the plugin check the repo for the [ngCordova-wrapper](https://github.com/TheCocoaProject/ngcordova-wrapper-nativestorage) - Ionic V1. The plugin is also supported for Ionic, please check the [official Ionic documentation](http://ionicframework.com/docs/v2/native/native-storage/) for the installation procedure and use.
111
-
112
-
113
-
114
-### <a name="reinstalling_dev"></a>Reinstalling/installing developer version
115
-Remove the plugin from the current project:
116
-```sh
117
-cordova plugin remove cordova-plugin-nativestorage
118
-```
119
-Install the developer version from Github:
120
-```sh
121
-cordova plugin add https://github.com/TheCocoaProject/cordova-plugin-nativestorage
122
-```
123
-
124
-## <a name="supported_platforms"></a>Supported platforms
125
-- Android
126
-- iOS
127
-- Browser (for testing purposes)
128
-- Windows (thanks to Christian Helbig see [PR](https://github.com/TheCocoaProject/cordova-plugin-nativestorage/pull/38))
129
-- OS X (thanks to [Javier Ribó](https://github.com/elribonazo) see [PR](https://github.com/TheCocoaProject/cordova-plugin-nativestorage/pull/58))
130
-
131
-## <a name="supported_frameworks"></a>Supported frameworks
132
-- [vanilla Cordova](https://www.npmjs.com/package/cordova-plugin-nativestorage)
133
-- [Cordova 3.9.2](https://github.com/GillesC/cordova-plugin-nativestorage-3.9.2-compatible) and previous versions
134
-- [Ionic](http://ionicframework.com/docs/v2/native/nativestorage/)
135
-- [ngCordova](https://github.com/TheCocoaProject/ngcordova-wrapper-nativestorage) (not all functions are yet supported)
136
-
137
-## <a name="usage"></a>Usage
138
-The parameter of the success-callback function will be the saved or retrieved value, the error-callback will specify the occurred error.
139
-
140
-### <a name="supported_data_types"></a>Supported data types
141
-As of version v2.0 all data types that can be stringified can be stored with the `setItem` and `getItem` method, see [storing values](#storing_values). A more fine grained storage method is also provided. These methods can be used to store type-specific data types, see [API prior to v2](https://github.com/TheCocoaProject/cordova-plugin-nativestorage/wiki/Usage-API-(prior-to-v2.0.0)).
142
-
143
-### <a name="storing_values"></a>Storing values
144
-```javascript
145
-NativeStorage.setItem("reference_to_value",<value>, <success-callback>, <error-callback>);
146
-```
147
-### <a name="retrieving_values"></a>Retrieving values
148
-```javascript
149
-NativeStorage.getItem("reference_to_value",<success-callback>, <error-callback>);
150
-```
151
-
152
-### <a name="retrieving_keys"></a>Retrieving all keys
153
-```javascript
154
-NativeStorage.keys(<success-callback>, <error-callback>);
155
-```
156
-
157
-### <a name="removing_values"></a>Removing values
158
-
159
-Removing a single variable:
160
-```javascript
161
-NativeStorage.remove("reference_to_value",<success-callback>, <error-callback>);
162
-```
163
-
164
-Removing all stored variables:
165
-```javascript
166
-NativeStorage.clear(<success-callback>, <error-callback>);
167
-```
168
-
169
-### iOS specific features
170
-- App Groups (share data between apps)
171
-First the suite name must be provided before accessing and retrieving data.
172
-```javascript
173
-NativeStorage.initWithSuiteName("suitename");
174
-```
175
-### <a name="example"></a>Example
176
-```javascript
177
-var app = {
178
-    initialize: function () {
179
-        this.bindEvents();
180
-    },
181
-    bindEvents: function () {
182
-        document.addEventListener('deviceready', this.onDeviceReady, false);
183
-    },
184
-    onDeviceReady: function () {
185
-        var obj = {name: "NativeStorage", author: "GillesCallebaut"};
186
-
187
-        // be certain to make an unique reference String for each variable!
188
-        NativeStorage.setItem("reference", obj, this.setSuccess, this.setError);
189
-    },
190
-    setSuccess: function (obj) {
191
-        console.log(obj.name);
192
-        NativeStorage.getItem("reference", this.getSuccess, this.getError);
193
-    },
194
-    setError: function (error) {
195
-        console.log(error.code);
196
-        if (error.exception !== "") console.log(error.exception);
197
-    },
198
-    getSuccess: function (obj) {
199
-        console.log(obj.name);
200
-        NativeStorage.remove("reference", this.removeSuccess, this.removeError);
201
-    },
202
-    getError: function (error) {
203
-        console.log(error.code);
204
-        if (error.exception !== "") console.log(error.exception);
205
-    },
206
-    removeSuccess: function () {
207
-        console.log("Removed");
208
-    },
209
-    removeError: function (error) {
210
-        console.log(error.code);
211
-        if (error.exception !== "") console.log(error.exception);
212
-    }
213
-};
214
-
215
-app.initialize();
216
-```
217
-
218
-### <a name="ngcordova_example"></a>ngCordova (Ionic V1) example
219
-```javascript
220
-var app = angular.module('starter.controllers', ['ngCordova.plugins.nativeStorage'])
221
-
222
-app.controller('myCtrl', function ($ionicPlatform, $scope, $cordovaNativeStorage, $log) {
223
-    $ionicPlatform.ready(function () {
224
-        $scope.$apply(function () {
225
-            $cordovaNativeStorage.setItem("ref", "value").then(function (value) {
226
-                $log.log(value);
227
-                $cordovaNativeStorage.getItem("ref").then(function (value) {
228
-                    $log.log(value);
229
-                }, function (error) {
230
-                    $log.log(error);
231
-                });
232
-            }, function (error) {
233
-                $log.log(error);
234
-            });
235
-        });
236
-    });
237
-});
238
-```
239
-
240
-### <a name="demo_example"></a>Demo Example
241
-A demo application can be found at `cordova-plugin-nativestorage/examples/demo`. This application will save a String when the SAVE (`btn_load`) is pushed. This String is the value which has been typed in the input field (`data_input`). When the LOAD button is pressed, the value is shown by means of an alert message.
242
-
243
-#### Installation
244
-* Cloning the repo to a local dir
245
-```sh
246
-git clone https://github.com/GillesC/cordova-plugin-nativestorage.git
247
-```
248
-* Navigating to the demo dir
249
-```sh
250
-cd cordova-plugin-nativestorage/examples/demo/
251
-```
252
-* Adding target platforms
253
-```sh
254
-cordova platform add ios
255
-cordova platform add android
256
-cordova platform add browser
257
-cordova platform add windows
258
-```
259
-* Adding the plugin
260
-```sh
261
-cordova plugin add cordova-plugin-nativestorage
262
-```
263
-* For testing the plugin
264
-```sh
265
-cordova plugin add http://git-wip-us.apache.org/repos/asf/cordova-plugin-test-framework.git
266
-cordova plugin add https://github.com/TheCocoaProject/cordova-plugin-nativestorage.git#:/tests
267
-```
268
-* Run or emulate the demo application
269
-```sh
270
-cordova emulate ios
271
-cordova run android
272
-cordova run browser
273
-cordova run windows
274
-```
275
-
276
-## <a name="security"></a>Security
277
-Is it safe to store sensitive data via this plugin?
278
- - Yes and No, all stored values are only accessible by your application, which makes it safe. However, the values can be viewed when the attacker has access to your phone's password (e.g. lock-pattern) through an un-encrypted back-up on Android (if back-up is enabled) or through root-access. The latter is only possible if the phone is rooted. An extra encryption mechanism would be of value when an extra user-supplied password is used. This mode is on our [Future Track](https://github.com/TheCocoaProject/cordova-plugin-nativestorage/wiki/Future-track) list.
279
-
280
-## <a name="errors"></a>Errors
281
-Error object contains:
282
-- code
283
-- source (= "Native"/"JS")
284
-- exception (if any, e.g. JSON exception)
285
-
286
-### Error codes
287
-the code contains an integer whichs specifies the occurred error/problem
288
-- `NATIVE_WRITE_FAILED` = 1
289
-- `ITEM_NOT_FOUND` = 2
290
-- `NULL_REFERENCE` = 3
291
-- `UNDEFINED_TYPE` = 4
292
-- `JSON_ERROR` = 5
293
-- `WRONG_PARAMETER` = 6
294
-
295
-## <a name="problems"></a>Problems
296
-If you encounter any problems, please remove the current plugin and re-add it.
297
-This will install the latest version.
298
-
299
-If you have code issues, things not related to a bug of the plugin please consider posting your question on Stackoverflow. And add our own tag, [cordova-nativestorage](http://stackoverflow.com/tags/cordova-nativestorage).
300
-
301
-- Be certain to only retrieve a saved value when the put/set success-callback method was invoked.
302
-- When using Ionic V1 the plugin can be undefined, the solution was descibed in issue [#10](../../issues/10):
303
-	* Remove `ng-app` from `body`
304
-	* put this code at the end of `index.html`:
305
-	* ```<script type="text/javascript"> document.addEventListener('deviceready', function onDeviceReady() { angular.bootstrap(document.querySelector('body'), ['starter']); }, false); </script>```
306
-- `Unknown provider: $cordovaNativeStorageProvider`
307
-	* Are you certain you've included the [wrapper](https://github.com/TheCocoaProject/ngcordova-wrapper-nativestorage)?
308
-- `Failed to instantiate module ngCordova.plugins.nativeStorage`
309
-- `Module 'ngCordova.plugins.nativeStorage' is not available`
310
-	* Check your bower json file (`bower.json`) to see if everything is correct
311
-	* be certain that the wrappers js file is included as described in the [README of the wrapper](https://github.com/TheCocoaProject/ngcordova-wrapper-nativestorage/blob/master/README.md)
312
-- Plugin doesn't seem to work in iOS 10
313
-	* Solution is presented on Stackoverflow in [this thread](http://stackoverflow.com/questions/38410159/cordova-app-hanging-during-startup-on-ios-10-beta). The issue was also discussed in issue [#36](../../issues/36).
314
-
315
-## <a name="FAQ"></a>F.A.Q.
316
-- Is data persistent between app updates?
317
-	* Yes. The data should persistent till the app has been deleted from the device. This because the plugin uses `Sharedpreferences` in Android and `NSUserDefaults` in iOS.
318
-- Oh no my stored data is not cleared after reinstalling my application. How do I resolve this 'issue'?
319
-	* You need to set `android:allowBackup=false` in the application tag of AndroidManifest.xml. More information at [this issue](https://github.com/TheCocoaProject/cordova-plugin-nativestorage/issues/57) and [this StackOverflow question](http://stackoverflow.com/questions/42538421/ionic-nativestorage-not-clear-when-reinstal-application-release).
320
-- What database are you using and why?
321
-	* None. The plugin uses `Sharedpreferences` in Android and `NSUserDefaults` in iOS. These strategies are designed for storing data quick and easy. See the [usage of the plugin](#when) for more info about DB vs NativeStorage.
322
-- Is it possible to save images and audio with the plugin?
323
-	* Yes. If you could stringify the data. Should I save imaged and audio is a different question. If the provided data isn't large and there isn't need to store a large amount of it, it will be OK.  See the [usage of the plugin](#when) for more info about storing large data with the plugin.
324
-- Is there a forum where people interested in the plugin could discuss issues like this?
325
-	* Yes
326
-		- See our own [issues page](https://github.com/TheCocoaProject/cordova-plugin-nativestorage/issues)
327
-		- Check out our [chat](https://gitter.im/TheCocoaProject/cordova-plugin-nativestorage?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) on Gitter
328
-- Can I access the saved value in Android?
329
-	* Yes, check out [this thread](http://stackoverflow.com/questions/39159754/how-get-data-from-cordova-plugin-nativestorage-in-android-java/39269620#39269620) on StackOverflow. Or see [this issue](https://github.com/TheCocoaProject/cordova-plugin-nativestorage/issues/53) on Github.
330
-- Can I access saved values in JavaScript?
331
-	* Yes, see [this thread](http://stackoverflow.com/questions/25657749/cordova-plugin-expose-js-variable-android-cardflight/39331899#39331899) on StackOverflow.
332
-- Does this plugin supports Cordova 3.9.2?
333
-	* Yes, look at [this fork](cordova-plugin-nativestorage-3.9.2-compatible)
334
-
335
-
336
-## <a name="applications"></a>Applications using this plugin
337
-
338
-- [Battles of East March](https://itunes.apple.com/us/app/id1135312617) (it was made using the Phaser game engine and compiled using CocoonJS)
339
-
340
-If you're utilizing this plugin and wish to add your application to this readme, please contact [me](mailto:callebaut.gilles@gmail.com).

+ 0
- 84
node_modules/cordova-plugin-nativestorage/package.json Datei anzeigen

@@ -1,84 +0,0 @@
1
-{
2
-  "_from": "cordova-plugin-nativestorage",
3
-  "_id": "cordova-plugin-nativestorage@2.3.2",
4
-  "_inBundle": false,
5
-  "_integrity": "sha512-olg/BzYRk0NGbKQ5f7rf21RYQEyJI19CCZn6RpVMO9/kbRRFqae/6ixjDNy81dXSu2TQ42brjBddGe1Qpn5ViA==",
6
-  "_location": "/cordova-plugin-nativestorage",
7
-  "_phantomChildren": {},
8
-  "_requested": {
9
-    "type": "tag",
10
-    "registry": true,
11
-    "raw": "cordova-plugin-nativestorage",
12
-    "name": "cordova-plugin-nativestorage",
13
-    "escapedName": "cordova-plugin-nativestorage",
14
-    "rawSpec": "",
15
-    "saveSpec": null,
16
-    "fetchSpec": "latest"
17
-  },
18
-  "_requiredBy": [
19
-    "#DEV:/",
20
-    "#USER"
21
-  ],
22
-  "_resolved": "https://registry.npmjs.org/cordova-plugin-nativestorage/-/cordova-plugin-nativestorage-2.3.2.tgz",
23
-  "_shasum": "d6a1d50632aff2a70227102f68bc605e91aabca2",
24
-  "_spec": "cordova-plugin-nativestorage",
25
-  "_where": "/Users/christian/Documents/artesanias",
26
-  "author": {
27
-    "name": "Gilles Callebaut",
28
-    "email": "callebaut.gilles@gmail.com"
29
-  },
30
-  "bugs": {
31
-    "url": "https://github.com/TheCocoaProject/cordova-plugin-nativestorage/issues"
32
-  },
33
-  "bundleDependencies": false,
34
-  "contributors": [
35
-    {
36
-      "name": "Alok Rajiv"
37
-    },
38
-    {
39
-      "name": "Yann Deshayes",
40
-      "email": "deshayes.yann@gmail.com",
41
-      "url": "https://github.com/ydeshayes"
42
-    }
43
-  ],
44
-  "cordova": {
45
-    "id": "cordova-plugin-nativestorage",
46
-    "platforms": [
47
-      "android",
48
-      "ios",
49
-      "browser",
50
-      "windows",
51
-      "osx"
52
-    ]
53
-  },
54
-  "deprecated": false,
55
-  "description": "Native storage of variables in Android, iOS and Windows",
56
-  "devDependencies": {
57
-    "jshint": "^2.9.1"
58
-  },
59
-  "homepage": "https://github.com/TheCocoaProject/cordova-plugin-nativestorage#README.md",
60
-  "keywords": [
61
-    "cordova",
62
-    "device",
63
-    "storage",
64
-    "ecosystem:cordova",
65
-    "cordova-android",
66
-    "cordova-ios",
67
-    "cordova-browser",
68
-    "cordova-windows",
69
-    "LocalStorage",
70
-    "NSUserDefaults",
71
-    "SharedPreferences"
72
-  ],
73
-  "license": "Apache-2.0",
74
-  "name": "cordova-plugin-nativestorage",
75
-  "repository": {
76
-    "type": "git",
77
-    "url": "git+https://github.com/TheCocoaProject/cordova-plugin-nativestorage.git"
78
-  },
79
-  "scripts": {
80
-    "jshint": "jshint www && jshint tests",
81
-    "test": "npm run jshint"
82
-  },
83
-  "version": "2.3.2"
84
-}

+ 0
- 70
node_modules/cordova-plugin-nativestorage/plugin.xml Datei anzeigen

@@ -1,70 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
3
-    xmlns:android="http://schemas.android.com/apk/res/android"
4
-    id="cordova-plugin-nativestorage"
5
-    version="2.3.2">
6
-    <name>NativeStorage</name>
7
-    <description>Native storage of variables in Android and iOS</description>
8
-    <license>Apache 2.0</license>
9
-    <keywords>cordova, native storage, LocalStorage, NSUserDefaults, SharedPreferences</keywords>
10
-    <repo></repo>
11
-    <issue></issue>
12
-
13
-    <js-module src="www/mainHandle.js" name="mainHandle">
14
-        <clobbers target="NativeStorage" />
15
-    </js-module>
16
-    <js-module src="www/LocalStorageHandle.js" name="LocalStorageHandle">
17
-    </js-module>
18
-    <js-module src="www/NativeStorageError.js" name="NativeStorageError">
19
-    </js-module>
20
-
21
-    <!-- android -->
22
-    <platform name="android">
23
-        <config-file target="res/xml/config.xml" parent="/*">
24
-            <feature name="NativeStorage">
25
-                <param name="android-package" value="NativeStorage"/>
26
-            </feature>
27
-        </config-file>
28
-        <source-file src="src/android/NativeStorage.java" target-dir="src/" />
29
-        <source-file src="src/android/Crypto.java" target-dir="src/" />
30
-    </platform>
31
-
32
-
33
-    <!-- ios -->
34
-    <platform name="ios">
35
-        <config-file target="config.xml" parent="/*">
36
-            <feature name="NativeStorage">
37
-                <param name="ios-package" value="NativeStorage"/>
38
-            </feature>
39
-        </config-file>
40
-        <header-file src="src/ios/NativeStorage.h"/>
41
-        <source-file src="src/ios/NativeStorage.m"/>
42
-    </platform>
43
-
44
-    <!-- Browser -->
45
-    <platform name="browser">
46
-        <config-file target="config.xml" parent="/*">
47
-            <feature name="NativeStorage">
48
-                <param name="browser-package" value="NativeStorage" />
49
-            </feature>
50
-        </config-file>
51
-    </platform>
52
-
53
-    <!-- osx -->
54
-    <platform name="osx">
55
-        <config-file target="config.xml" parent="/*">
56
-            <feature name="NativeStorage">
57
-                <param name="osx-package" value="NativeStorage" />
58
-            </feature>
59
-        </config-file>
60
-    </platform>
61
-
62
-    <!-- windows -->
63
-    <platform name="windows">
64
-        <js-module src="src/windows/NativeStorage.js" name="NativeStorage">
65
-            <runs />
66
-        </js-module>
67
-    </platform>
68
-
69
-
70
-</plugin>

+ 0
- 132
node_modules/cordova-plugin-nativestorage/src/android/Crypto.java Datei anzeigen

@@ -1,132 +0,0 @@
1
-import android.util.Base64;
2
-import android.util.Log;
3
-
4
-import java.io.UnsupportedEncodingException;
5
-import java.security.InvalidAlgorithmParameterException;
6
-import java.security.InvalidKeyException;
7
-import java.security.NoSuchAlgorithmException;
8
-import java.security.SecureRandom;
9
-import java.security.spec.InvalidKeySpecException;
10
-import java.security.spec.KeySpec;
11
-
12
-import javax.crypto.BadPaddingException;
13
-import javax.crypto.Cipher;
14
-import javax.crypto.IllegalBlockSizeException;
15
-import javax.crypto.NoSuchPaddingException;
16
-import javax.crypto.SecretKey;
17
-import javax.crypto.SecretKeyFactory;
18
-import javax.crypto.spec.IvParameterSpec;
19
-import javax.crypto.spec.PBEKeySpec;
20
-import javax.crypto.spec.SecretKeySpec;
21
-
22
-public class Crypto {
23
-
24
-    private static final String TAG = Crypto.class.getSimpleName();
25
-
26
-    public static final String PBKDF2_DERIVATION_ALGORITHM = "PBKDF2WithHmacSHA1"; // Android 10+
27
-    private static final String CIPHER_ALGORITHM = "AES/CBC/PKCS5Padding"; // Android 1+
28
-
29
-    private static String DELIMITER = "@~@~@";
30
-
31
-    private static int KEY_LENGTH = 256;
32
-    private static int ITERATION_COUNT = 10000;
33
-    private static final int PKCS5_SALT_LENGTH = 8;
34
-
35
-    private static SecureRandom random = new SecureRandom();
36
-
37
-
38
-    public static SecretKey deriveKeyPbkdf2(byte[] salt, String password) throws NoSuchAlgorithmException, InvalidKeySpecException {
39
-        long start = System.currentTimeMillis();
40
-        KeySpec keySpec = new PBEKeySpec(password.toCharArray(), salt,
41
-                ITERATION_COUNT, KEY_LENGTH);
42
-        SecretKeyFactory keyFactory = SecretKeyFactory
43
-                .getInstance(PBKDF2_DERIVATION_ALGORITHM);
44
-        byte[] keyBytes = keyFactory.generateSecret(keySpec).getEncoded();
45
-        Log.d(TAG, "key bytes: " + toHex(keyBytes));
46
-
47
-        SecretKey result = new SecretKeySpec(keyBytes, "AES");
48
-        long elapsed = System.currentTimeMillis() - start;
49
-        Log.d(TAG, String.format("PBKDF2 key derivation took %d [ms].",
50
-                elapsed));
51
-
52
-
53
-        return result;
54
-    }
55
-
56
-    public static byte[] generateIv(int length) {
57
-        byte[] b = new byte[length];
58
-        random.nextBytes(b);
59
-
60
-        return b;
61
-    }
62
-
63
-    public static byte[] generateSalt() {
64
-        byte[] b = new byte[PKCS5_SALT_LENGTH];
65
-        random.nextBytes(b);
66
-
67
-        return b;
68
-    }
69
-
70
-    public static String encrypt(String plaintext, String password) throws InvalidKeySpecException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidAlgorithmParameterException, InvalidKeyException, UnsupportedEncodingException, BadPaddingException, IllegalBlockSizeException {
71
-        byte[] salt = Crypto.generateSalt();
72
-        SecretKey key = deriveKeyPbkdf2(salt, password);
73
-        Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM);
74
-        byte[] iv = generateIv(cipher.getBlockSize());
75
-        Log.d(TAG, "IV: " + toHex(iv));
76
-        IvParameterSpec ivParams = new IvParameterSpec(iv);
77
-        cipher.init(Cipher.ENCRYPT_MODE, key, ivParams);
78
-        Log.d(TAG, "Cipher IV: "
79
-                + (cipher.getIV() == null ? null : toHex(cipher.getIV())));
80
-        byte[] cipherText = cipher.doFinal(plaintext.getBytes("UTF-8"));
81
-
82
-        if (salt != null) {
83
-            return String.format("%s%s%s%s%s", toBase64(salt), DELIMITER,
84
-                    toBase64(iv), DELIMITER, toBase64(cipherText));
85
-        }
86
-
87
-        return String.format("%s%s%s", toBase64(iv), DELIMITER,
88
-                toBase64(cipherText));
89
-    }
90
-
91
-    public static String toHex(byte[] bytes) {
92
-        StringBuilder buff = new StringBuilder();
93
-        for (byte b : bytes) {
94
-            buff.append(String.format("%02X", b));
95
-        }
96
-
97
-        return buff.toString();
98
-    }
99
-
100
-    public static String toBase64(byte[] bytes) {
101
-        return Base64.encodeToString(bytes, Base64.NO_WRAP);
102
-    }
103
-
104
-    public static byte[] fromBase64(String base64) {
105
-        return Base64.decode(base64, Base64.NO_WRAP);
106
-    }
107
-
108
-    public static String decrypt(byte[] cipherBytes, SecretKey key, byte[] iv) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidAlgorithmParameterException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException, UnsupportedEncodingException {
109
-        Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM);
110
-        IvParameterSpec ivParams = new IvParameterSpec(iv);
111
-        cipher.init(Cipher.DECRYPT_MODE, key, ivParams);
112
-        Log.d(TAG, "Cipher IV: " + toHex(cipher.getIV()));
113
-        byte[] plaintext = cipher.doFinal(cipherBytes);
114
-
115
-        return new String(plaintext, "UTF-8");
116
-    }
117
-
118
-    public static String decryptPbkdf2(String ciphertext, String password) throws InvalidKeySpecException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, UnsupportedEncodingException, IllegalBlockSizeException, BadPaddingException, InvalidAlgorithmParameterException {
119
-        String[] fields = ciphertext.split(DELIMITER);
120
-        if (fields.length != 3) {
121
-            throw new IllegalArgumentException("Invalid encypted text format");
122
-        }
123
-
124
-        byte[] salt = fromBase64(fields[0]);
125
-        byte[] iv = fromBase64(fields[1]);
126
-        byte[] cipherBytes = fromBase64(fields[2]);
127
-        SecretKey key = deriveKeyPbkdf2(salt, password);
128
-
129
-        return decrypt(cipherBytes, key, iv);
130
-    }
131
-
132
-}

+ 0
- 396
node_modules/cordova-plugin-nativestorage/src/android/NativeStorage.java Datei anzeigen

@@ -1,396 +0,0 @@
1
-import android.content.Context;
2
-import android.content.SharedPreferences;
3
-import android.util.Log;
4
-
5
-import org.apache.cordova.CallbackContext;
6
-import org.apache.cordova.CordovaInterface;
7
-import org.apache.cordova.CordovaPlugin;
8
-import org.apache.cordova.CordovaWebView;
9
-import org.json.JSONArray;
10
-import org.json.JSONException;
11
-
12
-import java.io.UnsupportedEncodingException;
13
-import java.security.InvalidAlgorithmParameterException;
14
-import java.security.InvalidKeyException;
15
-import java.security.NoSuchAlgorithmException;
16
-import java.security.spec.InvalidKeySpecException;
17
-
18
-import javax.crypto.BadPaddingException;
19
-import javax.crypto.IllegalBlockSizeException;
20
-import javax.crypto.NoSuchPaddingException;
21
-
22
-import java.util.Map;
23
-
24
-import android.app.Activity;
25
-
26
-public class NativeStorage extends CordovaPlugin {
27
-    public static final String TAG = "Native Storage";
28
-    private SharedPreferences sharedPref;
29
-    private SharedPreferences.Editor editor;
30
-
31
-    public NativeStorage() {
32
-    }
33
-
34
-
35
-    public void initialize(CordovaInterface cordova, CordovaWebView webView) {
36
-        super.initialize(cordova, webView);
37
-        Log.v(TAG, "Init NativeStorage");
38
-        String PREFS_NAME = preferences.getString("NativeStorageSharedPreferencesName", "NativeStorage");
39
-        sharedPref = cordova.getActivity().getSharedPreferences(PREFS_NAME, Activity.MODE_PRIVATE);
40
-        editor = sharedPref.edit();
41
-    }
42
-
43
-    public boolean execute(final String action, final JSONArray args, final CallbackContext callbackContext) throws JSONException {
44
-        if (("remove").equals(action)) {
45
-            cordova.getThreadPool().execute(new Runnable() {
46
-                public void run() {
47
-                    try {
48
-                        String ref = args.getString(0);
49
-                        editor.remove(ref);
50
-                        boolean success = editor.commit();
51
-                        if (success) callbackContext.success();
52
-                        else callbackContext.error("Remove operation failed");
53
-                    } catch (Exception e) {
54
-                        Log.e(TAG, "Removing failed :", e);
55
-                        callbackContext.error(e.getMessage());
56
-                    }
57
-                }
58
-            });
59
-            return true;
60
-        }
61
-
62
-        if (("clear").equals(action)) {
63
-            cordova.getThreadPool().execute(new Runnable() {
64
-                public void run() {
65
-                    try {
66
-                        editor.clear();
67
-                        boolean success = editor.commit();
68
-                        if (success) callbackContext.success();
69
-                        else callbackContext.error("Clear operation failed");
70
-                    } catch (Exception e) {
71
-                        Log.e(TAG, "Clearing failed :", e);
72
-                        callbackContext.error(e.getMessage());
73
-                    }
74
-                }
75
-            });
76
-            return true;
77
-        }
78
-
79
-        if (("putBoolean").equals(action)) {
80
-            cordova.getThreadPool().execute(new Runnable() {
81
-                public void run() {
82
-                    try {
83
-            /* getting arguments */
84
-                        String ref = args.getString(0);
85
-                        Boolean bool = args.getBoolean(1);
86
-                        editor.putBoolean(ref, bool);
87
-                        boolean success = editor.commit();
88
-                        if (success) callbackContext.success(String.valueOf(bool));
89
-                        else callbackContext.error("Write failed");
90
-                    } catch (Exception e) {
91
-                        Log.e(TAG, "PutBoolean failed :", e);
92
-                        callbackContext.error(e.getMessage());
93
-                    }
94
-                }
95
-            });
96
-            return true;
97
-        }
98
-
99
-        if (("getBoolean").equals(action)) {
100
-            cordova.getThreadPool().execute(new Runnable() {
101
-                public void run() {
102
-                    try {
103
-            /* getting arguments */
104
-                        String ref = args.getString(0);
105
-                        //System.out.println("Receveived reference: " + ref);
106
-                        Boolean bool = sharedPref.getBoolean(ref, false);
107
-                        callbackContext.success(String.valueOf(bool));
108
-                    } catch (Exception e) {
109
-                        Log.e(TAG, "PutBoolean failed :", e);
110
-                        callbackContext.error(e.getMessage());
111
-                    }
112
-                }
113
-            });
114
-            return true;
115
-        }
116
-
117
-        if (("putInt").equals(action)) {
118
-            cordova.getThreadPool().execute(new Runnable() {
119
-                public void run() {
120
-                    try {
121
-            /* getting arguments */
122
-                        String ref = args.getString(0);
123
-                        int anInt = args.getInt(1);
124
-                        editor.putInt(ref, anInt);
125
-                        boolean success = editor.commit();
126
-                        if (success) callbackContext.success(anInt);
127
-                        else callbackContext.error("Write failed");
128
-                    } catch (Exception e) {
129
-                        Log.e(TAG, "PutInt failed :", e);
130
-                        callbackContext.error(e.getMessage());
131
-                    }
132
-                }
133
-            });
134
-            return true;
135
-        }
136
-
137
-        if (("getInt").equals(action)) {
138
-            cordova.getThreadPool().execute(new Runnable() {
139
-                public void run() {
140
-                    try {
141
-            /* getting arguments */
142
-                        String ref = args.getString(0);
143
-                        //System.out.println("Receveived reference: "+ref);
144
-                        int anInt = sharedPref.getInt(ref, -1);
145
-                        callbackContext.success(anInt);
146
-                    } catch (Exception e) {
147
-                        Log.e(TAG, "GetInt failed :", e);
148
-                        callbackContext.error(e.getMessage());
149
-                    }
150
-                }
151
-            });
152
-            return true;
153
-        }
154
-
155
-        if (("putDouble").equals(action)) {
156
-            cordova.getThreadPool().execute(new Runnable() {
157
-                public void run() {
158
-                    try {
159
-            /* getting arguments */
160
-                        String ref = args.getString(0);
161
-                        float f = (float) args.getDouble(1);
162
-                        //Log.v(TAG,"Float value: "+f);
163
-                        editor.putFloat(ref, f);
164
-                        boolean success = editor.commit();
165
-                        if (success) callbackContext.success(Float.toString(f));
166
-                        else callbackContext.error("Write failed");
167
-                    } catch (Exception e) {
168
-                        Log.e(TAG, "PutFloat failed :", e);
169
-                        callbackContext.error(e.getMessage());
170
-                    }
171
-                }
172
-            });
173
-            return true;
174
-        }
175
-
176
-        if (("getDouble").equals(action)) {
177
-            cordova.getThreadPool().execute(new Runnable() {
178
-                public void run() {
179
-                    try {
180
-            /* getting arguments */
181
-                        String ref = args.getString(0);
182
-                        //System.out.println("Receveived reference: " + ref);
183
-                        float f = sharedPref.getFloat(ref, (float) -1.0);
184
-                        callbackContext.success(Float.toString(f));
185
-                    } catch (Exception e) {
186
-                        Log.e(TAG, "GetFloat failed :", e);
187
-                        callbackContext.error(e.getMessage());
188
-                    }
189
-                }
190
-            });
191
-            return true;
192
-        }
193
-
194
-        if (("putString").equals(action)) {
195
-            cordova.getThreadPool().execute(new Runnable() {
196
-                public void run() {
197
-                    try {
198
-            /* getting arguments */
199
-                        String ref = args.getString(0);
200
-                        String aString = args.getString(1);
201
-                        editor.putString(ref, aString);
202
-                        boolean success = editor.commit();
203
-                        if (success) callbackContext.success(aString);
204
-                        else callbackContext.error("Write failed");
205
-                    } catch (Exception e) {
206
-                        Log.e(TAG, "PutString failed :", e);
207
-                        callbackContext.error(e.getMessage());
208
-                    }
209
-                }
210
-            });
211
-            return true;
212
-        }
213
-
214
-        if (("getString").equals(action)) {
215
-            cordova.getThreadPool().execute(new Runnable() {
216
-                public void run() {
217
-                    try {
218
-            /* getting arguments */
219
-                        String ref = args.getString(0);
220
-                        //System.out.println("Receveived reference: " + ref);
221
-                        String s = sharedPref.getString(ref, "null");
222
-                        callbackContext.success(s);
223
-                    } catch (Exception e) {
224
-                        Log.e(TAG, "GetString failed :", e);
225
-                        callbackContext.error(e.getMessage());
226
-                    }
227
-                }
228
-            });
229
-            return true;
230
-        }
231
-
232
-        if (("setItem").equals(action)) {
233
-            cordova.getThreadPool().execute(new Runnable() {
234
-                public void run() {
235
-                    try {
236
-            /* getting arguments */
237
-                        String ref = args.getString(0);
238
-                        String aString = args.getString(1);
239
-                        editor.putString(ref, aString);
240
-                        boolean success = editor.commit();
241
-                        if (success) callbackContext.success(aString);
242
-                        else callbackContext.error(1); //nativeWrite failed
243
-                    } catch (Exception e) {
244
-                        Log.e(TAG, "setItem :", e);
245
-                        callbackContext.error(e.getMessage());
246
-                    }
247
-                }
248
-            });
249
-            return true;
250
-        }
251
-
252
-        if (("setItemWithPassword").equals(action)) {
253
-            cordova.getThreadPool().execute(new Runnable() {
254
-                public void run() {
255
-                    try {
256
-                        /* getting arguments */
257
-                        String ref = args.getString(0);
258
-                        String aString = args.getString(1);
259
-                        String pwd = args.getString(2);
260
-
261
-                        String ciphertext = "";
262
-                        try {
263
-                            ciphertext = Crypto.encrypt(aString, pwd);
264
-                        } catch (InvalidKeySpecException e) {
265
-                            e.printStackTrace();
266
-                            callbackContext.error(e.getMessage());
267
-                        } catch (NoSuchAlgorithmException e) {
268
-                            e.printStackTrace();
269
-                            callbackContext.error(e.getMessage());
270
-                        } catch (NoSuchPaddingException e) {
271
-                            e.printStackTrace();
272
-                            callbackContext.error(e.getMessage());
273
-                        } catch (InvalidAlgorithmParameterException e) {
274
-                            e.printStackTrace();
275
-                            callbackContext.error(e.getMessage());
276
-                        } catch (InvalidKeyException e) {
277
-                            e.printStackTrace();
278
-                            callbackContext.error(e.getMessage());
279
-                        } catch (UnsupportedEncodingException e) {
280
-                            e.printStackTrace();
281
-                            callbackContext.error(e.getMessage());
282
-                        } catch (BadPaddingException e) {
283
-                            e.printStackTrace();
284
-                            callbackContext.error(e.getMessage());
285
-                        } catch (IllegalBlockSizeException e) {
286
-                            e.printStackTrace();
287
-                            callbackContext.error(e.getMessage());
288
-                        }
289
-                        if (!ciphertext.equals("")) {
290
-                            editor.putString(ref, ciphertext);
291
-                            boolean success = editor.commit();
292
-                            if (success) callbackContext.success(aString);
293
-                            else callbackContext.error(1); //nativeWrite failed
294
-                        } else {
295
-                            callbackContext.error("Encryption failed");
296
-                        }
297
-
298
-                    } catch (Exception e) {
299
-                        Log.e(TAG, "setItem :", e);
300
-                        e.printStackTrace();
301
-                        callbackContext.error(e.getMessage());
302
-                    }
303
-                }
304
-            });
305
-            return true;
306
-        }
307
-
308
-        if (("getItem").equals(action)) {
309
-            cordova.getThreadPool().execute(new Runnable() {
310
-                public void run() {
311
-                    try {
312
-            /* getting arguments */
313
-                        String ref = args.getString(0);
314
-                        //System.out.println("Receveived reference: " + ref);
315
-                        String s = sharedPref.getString(ref, "nativestorage_null");
316
-                        if (s.equals("nativestorage_null")) {
317
-                            callbackContext.error(2);  // item not found
318
-                        } else callbackContext.success(s);
319
-                    } catch (Exception e) {
320
-                        Log.e(TAG, "getItem failed :", e);
321
-                        callbackContext.error(e.getMessage());
322
-                    }
323
-                }
324
-            });
325
-            return true;
326
-        }
327
-
328
-        if (("getItemWithPassword").equals(action)) {
329
-            cordova.getThreadPool().execute(new Runnable() {
330
-                public void run() {
331
-                    try {
332
-            /* getting arguments */
333
-                        String ref = args.getString(0);
334
-                        String pwd = args.getString(1);
335
-                        //System.out.println("Receveived reference: " + ref);
336
-                        String ciphertext = sharedPref.getString(ref, "nativestorage_null");
337
-                        if (ciphertext.equals("nativestorage_null")) {
338
-                            callbackContext.error(2);  // item not found
339
-                        } else {
340
-                            try {
341
-                                String plaintext = Crypto.decryptPbkdf2(ciphertext, pwd);
342
-                                callbackContext.success(plaintext);
343
-                            } catch (InvalidKeySpecException e) {
344
-                                e.printStackTrace();
345
-                                callbackContext.error(e.getMessage());
346
-                            } catch (NoSuchAlgorithmException e) {
347
-                                e.printStackTrace();
348
-                                callbackContext.error(e.getMessage());
349
-                            } catch (NoSuchPaddingException e) {
350
-                                e.printStackTrace();
351
-                                callbackContext.error(e.getMessage());
352
-                            } catch (InvalidAlgorithmParameterException e) {
353
-                                e.printStackTrace();
354
-                                callbackContext.error(e.getMessage());
355
-                            } catch (InvalidKeyException e) {
356
-                                e.printStackTrace();
357
-                                callbackContext.error(e.getMessage());
358
-                            } catch (UnsupportedEncodingException e) {
359
-                                e.printStackTrace();
360
-                                callbackContext.error(e.getMessage());
361
-                            } catch (BadPaddingException e) {
362
-                                e.printStackTrace();
363
-                                callbackContext.error(e.getMessage());
364
-                            } catch (IllegalBlockSizeException e) {
365
-                                e.printStackTrace();
366
-                                callbackContext.error(e.getMessage());
367
-                            }
368
-                        }
369
-                    } catch (Exception e) {
370
-                        Log.e(TAG, "getItem failed :", e);
371
-                        callbackContext.error(e.getMessage());
372
-                    }
373
-                }
374
-            });
375
-            return true;
376
-        }
377
-
378
-        if (("keys").equals(action)) {
379
-            cordova.getThreadPool().execute(new Runnable() {
380
-                public void run() {
381
-                    try {
382
-                        Map<String, ?> allEntries = sharedPref.getAll();
383
-                        callbackContext.success(new JSONArray(allEntries.keySet()));
384
-                    } catch (Exception e) {
385
-                        Log.e(TAG, "Get keys failed :", e);
386
-                        callbackContext.error(e.getMessage());
387
-                    }
388
-                }
389
-            });
390
-            return true;
391
-        }
392
-
393
-        return false;
394
-
395
-    }
396
-}

+ 0
- 28
node_modules/cordova-plugin-nativestorage/src/ios/NativeStorage.h Datei anzeigen

@@ -1,28 +0,0 @@
1
-#import <UIKit/UIKit.h>
2
-#import <Cordova/CDVPlugin.h>
3
-@interface NativeStorage : CDVPlugin
4
-
5
-- (void) initWithSuiteName: (CDVInvokedUrlCommand*) command;
6
-
7
-- (void) remove: (CDVInvokedUrlCommand*) command;
8
-- (void) clear: (CDVInvokedUrlCommand*) command;
9
-
10
-- (void) putBoolean: (CDVInvokedUrlCommand*) command;
11
-- (void) getBoolean: (CDVInvokedUrlCommand*) command;
12
-
13
-- (void) putInt: (CDVInvokedUrlCommand*) command;
14
-- (void) getInt: (CDVInvokedUrlCommand*) command;
15
-
16
-- (void) putDouble: (CDVInvokedUrlCommand*) command;
17
-- (void) getDouble: (CDVInvokedUrlCommand*) command;
18
-
19
-- (void) putString: (CDVInvokedUrlCommand*) command;
20
-- (void) getString: (CDVInvokedUrlCommand*) command;
21
-
22
-- (void) setItem: (CDVInvokedUrlCommand*) command;
23
-- (void) getItem: (CDVInvokedUrlCommand*) command;
24
-
25
-- (void) keys: (CDVInvokedUrlCommand*) command;
26
-
27
-
28
-@end

+ 0
- 298
node_modules/cordova-plugin-nativestorage/src/ios/NativeStorage.m Datei anzeigen

@@ -1,298 +0,0 @@
1
-#import "NativeStorage.h"
2
-#import <Cordova/CDVPlugin.h>
3
-
4
-@interface NativeStorage()
5
-@property NSUserDefaults *appGroupUserDefaults;
6
-@property NSString* suiteName;
7
-@end
8
-
9
-@implementation NativeStorage
10
-
11
-- (void) initWithSuiteName: (CDVInvokedUrlCommand*) command
12
-{
13
-    [self.commandDelegate runInBackground:^{
14
-        CDVPluginResult* pluginResult = nil;
15
-        NSString* aSuiteName = [command.arguments objectAtIndex:0];
16
-        
17
-        if(aSuiteName!=nil)
18
-        {
19
-            _suiteName = aSuiteName;
20
-            _appGroupUserDefaults = [[NSUserDefaults alloc] initWithSuiteName:_suiteName];
21
-        }
22
-        else
23
-        {
24
-            pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_ERROR messageAsString:@"Reference or SuiteName was null"];
25
-        }
26
-        [self.commandDelegate sendPluginResult:pluginResult callbackId: command.callbackId];
27
-    }];
28
-}
29
-
30
-- (NSUserDefaults*) getUserDefault {
31
-	if (_suiteName != nil)
32
-	{
33
-        return _appGroupUserDefaults;
34
-	}
35
-	return [NSUserDefaults standardUserDefaults];
36
-}
37
-
38
-- (void) remove: (CDVInvokedUrlCommand*) command
39
-{
40
-	[self.commandDelegate runInBackground:^{
41
-		CDVPluginResult* pluginResult = nil;
42
-		NSString* reference = [command.arguments objectAtIndex:0];
43
-
44
-		if(reference!=nil)
45
-		{
46
-			NSUserDefaults *defaults = [self getUserDefault];
47
-			[defaults removeObjectForKey: reference];
48
-			BOOL success = [defaults synchronize];
49
-			if(success) pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK];
50
-			else pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_ERROR messageAsString:@"Remove has failed"];
51
-		}
52
-		else
53
-		{
54
-			pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_ERROR messageAsString:@"Reference was null"];
55
-		}
56
-		[self.commandDelegate sendPluginResult:pluginResult callbackId: command.callbackId];
57
-	}];
58
-}
59
-
60
-- (void) clear: (CDVInvokedUrlCommand*) command
61
-{
62
-	[self.commandDelegate runInBackground:^{
63
-		CDVPluginResult* pluginResult = nil;
64
-		[[self getUserDefault] removePersistentDomainForName:[[NSBundle mainBundle] bundleIdentifier]];
65
-		BOOL success = [[self getUserDefault] synchronize];
66
-		if(success) pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK];
67
-		else pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_ERROR messageAsString:@"Clear has failed"];
68
-		[self.commandDelegate sendPluginResult:pluginResult callbackId: command.callbackId];
69
-	}];
70
-}
71
-
72
-- (void) putBoolean: (CDVInvokedUrlCommand*) command
73
-{
74
-	[self.commandDelegate runInBackground:^{
75
-		CDVPluginResult* pluginResult = nil;
76
-		NSString* reference = [command.arguments objectAtIndex:0];
77
-		BOOL aBoolean = [command.arguments objectAtIndex:1];
78
-
79
-		if(reference!=nil)
80
-		{
81
-			NSUserDefaults *defaults = [self getUserDefault];
82
-			[defaults setBool: aBoolean forKey:reference];
83
-			BOOL success = [defaults synchronize];
84
-			if(success) pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK messageAsBool:aBoolean];
85
-			else pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_ERROR messageAsString:@"Write has failed"];
86
-		}
87
-		else
88
-		{
89
-			pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_ERROR messageAsString:@"Reference was null"];
90
-		}
91
-		[self.commandDelegate sendPluginResult:pluginResult callbackId: command.callbackId];
92
-	}];
93
-}
94
-- (void) getBoolean: (CDVInvokedUrlCommand*) command
95
-{
96
-	[self.commandDelegate runInBackground:^{
97
-		CDVPluginResult* pluginResult = nil;
98
-		NSString* reference = [command.arguments objectAtIndex:0];
99
-
100
-		if(reference!=nil)
101
-		{
102
-			BOOL aBoolean = [[self getUserDefault] boolForKey:reference];
103
-			pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK messageAsBool:aBoolean];
104
-		}
105
-		else
106
-		{
107
-			pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_ERROR messageAsString:@"Reference was null"];
108
-		}
109
-		[self.commandDelegate sendPluginResult:pluginResult callbackId: command.callbackId];
110
-	}];
111
-}
112
-
113
-- (void) putInt: (CDVInvokedUrlCommand*) command
114
-{
115
-	[self.commandDelegate runInBackground:^{
116
-		CDVPluginResult* pluginResult = nil;
117
-		NSString* reference = [command.arguments objectAtIndex:0];
118
-		NSInteger anInt = [[command.arguments objectAtIndex:1] integerValue];
119
-
120
-		if(reference!=nil)
121
-		{
122
-			NSUserDefaults *defaults = [self getUserDefault];
123
-			[defaults setInteger: anInt forKey:reference];
124
-			BOOL success = [defaults synchronize];
125
-			if(success) pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK messageAsNSInteger:anInt];
126
-			else pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_ERROR messageAsString:@"Write has failed"];
127
-		}
128
-		else
129
-		{
130
-			pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_ERROR messageAsString:@"Reference was null"];
131
-		}
132
-		[self.commandDelegate sendPluginResult:pluginResult callbackId: command.callbackId];
133
-	}];
134
-}
135
-- (void) getInt: (CDVInvokedUrlCommand*) command
136
-{
137
-	[self.commandDelegate runInBackground:^{
138
-		CDVPluginResult* pluginResult = nil;
139
-		NSString* reference = [command.arguments objectAtIndex:0];
140
-
141
-		if(reference!=nil)
142
-		{
143
-			NSInteger anInt = [[self getUserDefault] integerForKey:reference];
144
-			pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK messageAsNSInteger:anInt];
145
-		}
146
-		else
147
-		{
148
-			pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_ERROR messageAsString:@"Reference was null"];
149
-		}
150
-		[self.commandDelegate sendPluginResult:pluginResult callbackId: command.callbackId];
151
-	}];
152
-}
153
-
154
-
155
-- (void) putDouble: (CDVInvokedUrlCommand*) command
156
-{
157
-	[self.commandDelegate runInBackground:^{
158
-		CDVPluginResult* pluginResult = nil;
159
-		NSString* reference = [command.arguments objectAtIndex:0];
160
-		double aDouble = [[command.arguments objectAtIndex:1] doubleValue];
161
-
162
-		if(reference!=nil)
163
-		{
164
-			NSUserDefaults *defaults = [self getUserDefault];
165
-			[defaults setDouble: aDouble forKey:reference];
166
-			BOOL success = [defaults synchronize];
167
-			if(success) pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK messageAsDouble:aDouble];
168
-			else pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_ERROR messageAsString:@"Write has failed"];
169
-		}
170
-		else
171
-		{
172
-			pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_ERROR messageAsString:@"Reference was null"];
173
-		}
174
-		[self.commandDelegate sendPluginResult:pluginResult callbackId: command.callbackId];
175
-	}];
176
-}
177
-- (void) getDouble: (CDVInvokedUrlCommand*) command
178
-{
179
-	[self.commandDelegate runInBackground:^{
180
-		CDVPluginResult* pluginResult = nil;
181
-		NSString* reference = [command.arguments objectAtIndex:0];
182
-
183
-		if(reference!=nil)
184
-		{
185
-			double aDouble = [[self getUserDefault] doubleForKey:reference];
186
-			pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK messageAsDouble:aDouble];
187
-		}
188
-		else
189
-		{
190
-			pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_ERROR messageAsString:@"Reference was null"];
191
-		}
192
-		[self.commandDelegate sendPluginResult:pluginResult callbackId: command.callbackId];
193
-	}];
194
-}
195
-
196
-- (void) putString: (CDVInvokedUrlCommand*) command
197
-{
198
-	[self.commandDelegate runInBackground:^{
199
-		CDVPluginResult* pluginResult = nil;
200
-		NSString* reference = [command.arguments objectAtIndex:0];
201
-		NSString* aString = [command.arguments objectAtIndex:1];
202
-
203
-		if(reference!=nil)
204
-		{
205
-			NSUserDefaults *defaults = [self getUserDefault];
206
-			[defaults setObject: aString forKey:reference];
207
-			BOOL success = [defaults synchronize];
208
-			if(success) pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK messageAsString:aString];
209
-			else pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_ERROR messageAsString:@"Write has failed"];
210
-
211
-		}
212
-		else
213
-		{
214
-			pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_ERROR messageAsString:@"Reference was null"];
215
-		}
216
-		[self.commandDelegate sendPluginResult:pluginResult callbackId: command.callbackId];
217
-	}];
218
-}
219
-- (void) getString: (CDVInvokedUrlCommand*) command
220
-{
221
-	[self.commandDelegate runInBackground:^{
222
-		CDVPluginResult* pluginResult = nil;
223
-		NSString* reference = [command.arguments objectAtIndex:0];
224
-
225
-		if(reference!=nil)
226
-		{
227
-			NSString* aString = [[self getUserDefault] stringForKey:reference];
228
-			pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK messageAsString:aString];
229
-		}
230
-		else
231
-		{
232
-			pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_ERROR messageAsString:@"Reference was null"];
233
-		}
234
-		[self.commandDelegate sendPluginResult:pluginResult callbackId: command.callbackId];
235
-	}];
236
-}
237
-
238
-
239
-- (void) setItem: (CDVInvokedUrlCommand*) command
240
-{
241
-	[self.commandDelegate runInBackground:^{
242
-		CDVPluginResult* pluginResult = nil;
243
-		NSString* reference = [command.arguments objectAtIndex:0];
244
-		NSString* aString = [command.arguments objectAtIndex:1];
245
-
246
-		if(reference==nil || [aString class] == [NSNull class])
247
-		{
248
-			pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_ERROR messageAsInt:3];
249
-		}
250
-		else
251
-		{
252
-			NSUserDefaults *defaults = [self getUserDefault];
253
-			[defaults setObject: aString forKey:reference];
254
-			BOOL success = [defaults synchronize];
255
-			if(success) pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK messageAsString:aString];
256
-			else pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_ERROR messageAsInt:1]; //Write has failed
257
-		}
258
-
259
-		[self.commandDelegate sendPluginResult:pluginResult callbackId: command.callbackId];
260
-	}];
261
-}
262
-
263
-- (void) getItem: (CDVInvokedUrlCommand*) command
264
-{
265
-	[self.commandDelegate runInBackground:^{
266
-		CDVPluginResult* pluginResult = nil;
267
-		NSString* reference = [command.arguments objectAtIndex:0];
268
-
269
-		if(reference!=nil)
270
-		{
271
-			NSString* aString = [[self getUserDefault] stringForKey:reference];
272
-			pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK messageAsString:aString];
273
-			if(aString==nil)
274
-			{
275
-				pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_ERROR messageAsInt:2]; //Ref not found
276
-			}
277
-		}
278
-		else
279
-		{
280
-			pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_ERROR messageAsInt:3]; //Reference was null
281
-		}
282
-		[self.commandDelegate sendPluginResult:pluginResult callbackId: command.callbackId];
283
-	}];
284
-}
285
-
286
-- (void) keys: (CDVInvokedUrlCommand*) command
287
-{
288
-	[self.commandDelegate runInBackground:^{
289
-		CDVPluginResult* pluginResult = nil;
290
-		NSArray *keys = [[[self getUserDefault] dictionaryRepresentation] allKeys];
291
-		pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK messageAsArray:keys];
292
-
293
-		[self.commandDelegate sendPluginResult:pluginResult callbackId: command.callbackId];
294
-	}];
295
-}
296
-
297
-
298
-@end

+ 0
- 158
node_modules/cordova-plugin-nativestorage/src/windows/NativeStorage.js Datei anzeigen

@@ -1,158 +0,0 @@
1
-/**
2
- * Created by Christian on 30.08.2016.
3
- * christian@helbighof.de
4
- */
5
-
6
-var package = Windows.ApplicationModel.Package.current;
7
-var service = package.id.name
8
-
9
-var NativeStorageProxy = {
10
-    getItem: function (win, fail, args) {
11
-        try {
12
-            var key = args[0];
13
-            var vault = new Windows.Security.Credentials.PasswordVault();
14
-            var passwordCredential = vault.retrieve(service, key);
15
-            win(passwordCredential.password);
16
-        } catch (e) {
17
-            fail(2);
18
-        }
19
-    },
20
-    setItem: function (win, fail, args) {
21
-        try {
22
-            var key = args[0];
23
-            var value = args[1];
24
-            var vault = new Windows.Security.Credentials.PasswordVault();
25
-            vault.add(new Windows.Security.Credentials.PasswordCredential(service, key, value));
26
-            win(value);
27
-        } catch (e) {
28
-            fail(1);
29
-        }
30
-    },
31
-    clear: function (win, fail, args) {
32
-        //todo: Clear all values in NativeStorage
33
-        try {
34
-            var vault = new Windows.Security.Credentials.PasswordVault();
35
-            var iVectorView = vault.retrieveAll();
36
-            if (iVectorView == null)
37
-                win();
38
-            for (var i = 0; i < iVectorView.size; i++) {
39
-                vault.remove(iVectorView[i]);
40
-            }
41
-            win();
42
-        } catch (e) {
43
-            fail();
44
-        }
45
-    },
46
-    putString: function (win, fail, args) {
47
-        try {
48
-            var key = args[0];
49
-            var value = args[1];
50
-            var vault = new Windows.Security.Credentials.PasswordVault();
51
-            vault.add(new Windows.Security.Credentials.PasswordCredential(service, key, value));
52
-            win(value);
53
-        } catch (e) {
54
-            fail(1);
55
-        }
56
-    },
57
-    getString: function (win, fail, args) {
58
-        try {
59
-            var key = args[0];
60
-            var vault = new Windows.Security.Credentials.PasswordVault();
61
-            var passwordCredential = vault.retrieve(service, key);
62
-            win(passwordCredential.password);
63
-        } catch (e) {
64
-            fail(2);
65
-        }
66
-    },
67
-    putBoolean: function (win, fail, args) {
68
-        try {
69
-            var key = args[0];
70
-            var value = args[1];
71
-            var vault = new Windows.Security.Credentials.PasswordVault();
72
-            vault.add(new Windows.Security.Credentials.PasswordCredential(service, key, value));
73
-            win(value);
74
-        } catch (e) {
75
-            fail(1);
76
-        }
77
-    },
78
-    getBoolean: function (win, fail, args) {
79
-        try {
80
-            var key = args[0];
81
-            var vault = new Windows.Security.Credentials.PasswordVault();
82
-            var passwordCredential = vault.retrieve(service, key);
83
-            win(passwordCredential.password);
84
-        } catch (e) {
85
-            fail(2);
86
-        }
87
-    },
88
-    putInt: function (win, fail, args) {
89
-        try {
90
-            var key = args[0];
91
-            var value = args[1];
92
-            var vault = new Windows.Security.Credentials.PasswordVault();
93
-            vault.add(new Windows.Security.Credentials.PasswordCredential(service, key, value));
94
-            win(value);
95
-        } catch (e) {
96
-            fail(1);
97
-        }
98
-    },
99
-    getInt: function (win, fail, args) {
100
-        try {
101
-            var key = args[0];
102
-            var vault = new Windows.Security.Credentials.PasswordVault();
103
-            var passwordCredential = vault.retrieve(service, key);
104
-            win(parseInt(passwordCredential.password));
105
-        } catch (e) {
106
-            fail(2);
107
-        }
108
-    },
109
-    putDouble: function (win, fail, args) {
110
-        try {
111
-            var key = args[0];
112
-            var value = args[1];
113
-            var vault = new Windows.Security.Credentials.PasswordVault();
114
-            vault.add(new Windows.Security.Credentials.PasswordCredential(service, key, value));
115
-            win(value);
116
-        } catch (e) {
117
-            fail(1);
118
-        }
119
-    },
120
-    getDouble: function (win, fail, args) {
121
-        try {
122
-            var key = args[0];
123
-            var vault = new Windows.Security.Credentials.PasswordVault();
124
-            var passwordCredential = vault.retrieve(service, key);
125
-            win(passwordCredential.password);
126
-        } catch (e) {
127
-            fail(2);
128
-        }
129
-    },
130
-    remove: function (win, fail, args) {
131
-        try {
132
-            var key = args[0];
133
-            var vault = new Windows.Security.Credentials.PasswordVault();
134
-            var passwordCredential = vault.retrieve(service, key);
135
-            if (passwordCredential) {
136
-                vault.remove(passwordCredential);
137
-            }
138
-            win(key);
139
-        } catch (e) {
140
-            fail(2);
141
-        }
142
-    },
143
-    keys: function (win, fail) {
144
-        try {
145
-            var vault = new Windows.Security.Credentials.PasswordVault();
146
-            var all = vault.retrieveAll();
147
-            var keys = [];
148
-            for(var i=0;i<all.Size;i++) {
149
-              keys.push(all.GetAt(i).UserName);
150
-            }
151
-            win(keys);
152
-        } catch (e) {
153
-            fail(2);
154
-        }
155
-    },
156
-};
157
-
158
-require("cordova/exec/proxy").add("NativeStorage", NativeStorageProxy);

+ 0
- 418
node_modules/cordova-plugin-nativestorage/tests/main.js Datei anzeigen

@@ -1,418 +0,0 @@
1
-/* jshint jasmine: true */
2
-/* global NativeStorage */
3
-exports.defineAutoTests = function() {
4
-
5
-  describe('Write/Read/Delete Tests', function() {
6
-    it("checks if th plugin is available", function() {
7
-      expect(NativeStorage).toEqual(jasmine.anything());
8
-    });
9
-    it('Booleans', function(done) {
10
-      var dummyData = true;
11
-      NativeStorage.set("dummy_ref_bool",
12
-        dummyData,
13
-        function(result) {
14
-          NativeStorage.getBoolean("dummy_ref_bool",
15
-            function(result) {
16
-              expect(result).toEqual(dummyData);
17
-              NativeStorage.remove("dummy_ref_bool", function() {
18
-                done();
19
-              }, function(e) {
20
-                fail("Delete Boolean Failed");
21
-              });
22
-            },
23
-            function(e) {
24
-              fail("Read Boolean Failed");
25
-            });
26
-        },
27
-        function(e) {
28
-          fail("Write Boolean Failed");
29
-        });
30
-    });
31
-    it('Ints', function(done) {
32
-      var dummyData = 154243;
33
-      NativeStorage.set("dummy_ref_int",
34
-        dummyData,
35
-        function(result) {
36
-          NativeStorage.getInt("dummy_ref_int",
37
-            function(result) {
38
-              expect(result).toEqual(dummyData);
39
-              NativeStorage.remove("dummy_ref_int", function() {
40
-                done();
41
-              }, function(e) {
42
-                fail("Delete Boolean Failed");
43
-              });
44
-            },
45
-            function(e) {
46
-              fail("Read Int Failed");
47
-            });
48
-        },
49
-        function(e) {
50
-          fail("Write Int Failed");
51
-        });
52
-    });
53
-    it('Doubles', function(done) {
54
-      var dummyData = 12327.023;
55
-      NativeStorage.set("dummy_ref_double",
56
-        dummyData,
57
-        function(result) {
58
-          NativeStorage.getDouble("dummy_ref_double",
59
-            function(result) {
60
-              expect(result).toEqual(dummyData);
61
-              NativeStorage.remove("dummy_ref_double", function() {
62
-                done();
63
-              }, function(e) {
64
-                fail("Delete Boolean Failed");
65
-              });
66
-            },
67
-            function(e) {
68
-              fail("Read Double Failed");
69
-            });
70
-        },
71
-        function(e) {
72
-          fail("Write String Failed");
73
-        });
74
-    });
75
-    it('Strings', function(done) {
76
-      var dummyData = "sdadadfsjdhbfwehfnciu7834fybzx2lnqo8japf;ckamicoa.c.a/";
77
-      NativeStorage.set("dummy_ref_str",
78
-        dummyData,
79
-        function(result) {
80
-          NativeStorage.getString("dummy_ref_str",
81
-            function(result) {
82
-              expect(result).toEqual(dummyData);
83
-              NativeStorage.remove("dummy_ref_str", function() {
84
-                done();
85
-              }, function(e) {
86
-                fail("Delete Boolean Failed");
87
-              });
88
-            },
89
-            function(e) {
90
-              fail("Read String Failed");
91
-            });
92
-        },
93
-        function(e) {
94
-          fail("Write String Failed");
95
-        });
96
-    });
97
-    it('Objects', function(done) {
98
-      var dummyData = {
99
-        data1: "",
100
-        data2: 2,
101
-        data3: 3.0
102
-      };
103
-      NativeStorage.set("dummy_ref_obj",
104
-        dummyData,
105
-        function(result) {
106
-          NativeStorage.getObject("dummy_ref_obj",
107
-            function(result) {
108
-              expect(result).toEqual(dummyData);
109
-              NativeStorage.remove("dummy_ref_obj", function() {
110
-                done();
111
-              }, function(e) {
112
-                fail("Delete Boolean Failed");
113
-              });
114
-            },
115
-            function(e) {
116
-              fail("Read Object Failed");
117
-            });
118
-        },
119
-        function(e) {
120
-          fail("Write Object Failed");
121
-        });
122
-    });
123
-  });
124
-
125
-  /* NEW API test */
126
-  describe('Write/Read/Delete Tests new API', function() {
127
-    it("Plugin available", function() {
128
-      expect(NativeStorage).toEqual(jasmine.anything());
129
-    });
130
-    it('Booleans', function(done) {
131
-      var dummyData = true;
132
-      NativeStorage.setItem("dummy_ref_bool_new",
133
-        dummyData,
134
-        function(result) {
135
-          NativeStorage.getItem("dummy_ref_bool_new",
136
-            function(result) {
137
-              expect(result).toEqual(dummyData);
138
-              NativeStorage.remove("dummy_ref_bool_new", function() {
139
-                done();
140
-              }, function(e) {
141
-                fail("Delete Boolean Failed");
142
-              });
143
-            },
144
-            function(e) {
145
-              fail("Read Boolean Failed");
146
-            });
147
-        },
148
-        function(e) {
149
-          fail("Write Boolean Failed");
150
-        });
151
-    });
152
-    it('Ints', function(done) {
153
-      var dummyData = 154243;
154
-      NativeStorage.setItem("dummy_ref_int_new",
155
-        dummyData,
156
-        function(result) {
157
-          NativeStorage.getItem("dummy_ref_int_new",
158
-            function(result) {
159
-              expect(result).toEqual(dummyData);
160
-              NativeStorage.remove("dummy_ref_int_new", function() {
161
-                done();
162
-              }, function(e) {
163
-                fail("Delete Boolean Failed");
164
-              });
165
-            },
166
-            function(e) {
167
-              fail("Read Int Failed");
168
-            });
169
-        },
170
-        function(e) {
171
-          fail("Write Int Failed");
172
-        });
173
-    });
174
-    it('Doubles', function(done) {
175
-      var dummyData = 12327.023;
176
-      NativeStorage.setItem("dummy_ref_double_new",
177
-        dummyData,
178
-        function(result) {
179
-          NativeStorage.getItem("dummy_ref_double_new",
180
-            function(result) {
181
-              expect(result).toEqual(dummyData);
182
-              NativeStorage.remove("dummy_ref_double_new", function() {
183
-                done();
184
-              }, function(e) {
185
-                fail("Delete Boolean Failed");
186
-              });
187
-            },
188
-            function(e) {
189
-              fail("Read Double Failed");
190
-            });
191
-        },
192
-        function(e) {
193
-          fail("Write String Failed");
194
-        });
195
-    });
196
-    it('Strings', function(done) {
197
-      var dummyData = "sdadadfsjdhbfwehfnciu7834fybzx2lnqo8japf;ckamicoa.c.a/";
198
-      NativeStorage.setItem("dummy_ref_str_new",
199
-        dummyData,
200
-        function(result) {
201
-          NativeStorage.getItem("dummy_ref_str_new",
202
-            function(result) {
203
-              expect(result).toEqual(dummyData);
204
-              NativeStorage.remove("dummy_ref_str_new", function() {
205
-                done();
206
-              }, function(e) {
207
-                fail("Delete Boolean Failed");
208
-              });
209
-            },
210
-            function(e) {
211
-              fail("Read String Failed");
212
-            });
213
-        },
214
-        function(e) {
215
-          fail("Write String Failed");
216
-        });
217
-    });
218
-    it('Objects', function(done) {
219
-      var dummyData = {
220
-        data1: "",
221
-        data2: 2,
222
-        data3: 3.0
223
-      };
224
-      NativeStorage.setItem("dummy_ref_obj_new",
225
-        dummyData,
226
-        function(result) {
227
-          NativeStorage.getItem("dummy_ref_obj_new",
228
-            function(result) {
229
-              expect(result).toEqual(dummyData);
230
-              NativeStorage.remove("dummy_ref_obj_new", function() {
231
-                done();
232
-              }, function(e) {
233
-                fail("Delete Boolean Failed");
234
-              });
235
-            },
236
-            function(e) {
237
-              fail("Read Object Failed");
238
-            });
239
-        },
240
-        function(e) {
241
-          fail("Write Object Failed");
242
-        });
243
-    });
244
-  });
245
-
246
-
247
-  /* NEW API test */
248
-  describe('Fail Tests new API', function() {
249
-    it("Plugin available", function() {
250
-      expect(NativeStorage).toEqual(jasmine.anything());
251
-    });
252
-    it('Null reference', function(done) {
253
-      NativeStorage.setItem(null, "objbio",
254
-        function(result) {
255
-          fail("Item should not have been found, because ref is null " + result);
256
-        },
257
-        function(e) {
258
-          expect(e.code).toEqual(3);
259
-          done();
260
-        });
261
-    });
262
-
263
-    it('Item Not Found', function(done) {
264
-      NativeStorage.getItem("dummy_ref_fail",
265
-        function(result) {
266
-          fail("Item should not have been found " + result);
267
-        },
268
-        function(e) {
269
-          expect(e.code).toEqual(2);
270
-          done();
271
-        });
272
-    });
273
-
274
-    it('bad JSON', function(done) {
275
-      var a = {};
276
-      a.a = a;
277
-      NativeStorage.setItem("dummy_ref_bad_json", a, function(result) {
278
-        fail("JSON stringify should give an error " + result);
279
-      },
280
-        function(e) {
281
-          expect(e.code).toEqual(5);
282
-          done();
283
-        });
284
-    });
285
-
286
-
287
-  });
288
-
289
-  /* NEW API test with Password encryption*/
290
-  describe('Password encryption Tests new API', function() {
291
-    it("Plugin available", function() {
292
-      expect(NativeStorage).toEqual(jasmine.anything());
293
-    });
294
-    it('should store, retrieve and remove a secret item', function(done) {
295
-      //reference, obj, encryptConfig, success, error
296
-      NativeStorage.setSecretItem("ref_to_secret_value", "SomeVerySecretText", {
297
-        mode: "password",
298
-        value: "mySecretPassword"
299
-      },
300
-        function(result) {
301
-          // Oke good we've set the secret
302
-          expect(result).toEqual("SomeVerySecretText");
303
-          // let's grab it back
304
-          NativeStorage.getSecretItem("ref_to_secret_value", {
305
-            mode: "password",
306
-            value: "mySecretPassword"
307
-          }, function(result) {
308
-            // we've got it again, yes! :D
309
-            // let's remove it
310
-            NativeStorage.remove("ref_to_secret_value", function() {
311
-              // We're done!
312
-              done();
313
-            }, function(e) {
314
-              fail("Delete item Failed");
315
-            });
316
-          }, function(e) {
317
-            fail("Get item Failed");
318
-          });
319
-        },
320
-        function(e) {
321
-          fail("Set item Failed");
322
-        });
323
-    });
324
-
325
-  });
326
-
327
-  /* NEW API test with Password encryption*/
328
-  describe('Password encryption Error Tests new API', function() {
329
-    it("Plugin available", function() {
330
-      expect(NativeStorage).toEqual(jasmine.anything());
331
-    });
332
-    it('should invoke the error callback function for a secret item', function(done) {
333
-      //reference, obj, encryptConfig, success, error
334
-      NativeStorage.setSecretItem("ref_to_secret_value", "SomeVerySecretText", {
335
-        mode: "password",
336
-        value: "mySecretPassword"
337
-      },
338
-        function(result) {
339
-          // Oke good we've set the secret
340
-          expect(result).toEqual("SomeVerySecretText");
341
-          // let's grab it back
342
-          NativeStorage.getSecretItem("ref_to_secret_value", {
343
-            mode: "password",
344
-            value: "SomeOhterPassword"
345
-          }, function(result) {
346
-            // if we are in the browser
347
-            if ((window.cordova && window.cordova.platformId === 'browser') || !(window.phonegap || window.cordova)) {
348
-              done();
349
-            }
350
-            fail("We've giving the pasword so it shouldn't work");
351
-            NativeStorage.remove("ref_to_secret_value", function() {
352
-              fail("We shouldn't got here... maybe we are in a browser!");
353
-            }, function(e) {
354
-              fail("Delete item Failed");
355
-            });
356
-          },
357
-            function(e) {
358
-              done(e);
359
-            });
360
-        },
361
-        function(e) {
362
-          fail("Set item Failed");
363
-        });
364
-    });
365
-
366
-  });
367
-
368
-
369
-  /* NEW API test with clear() function*/
370
-  describe('clear function', function() {
371
-    it("Plugin available", function() {
372
-      expect(NativeStorage).toEqual(jasmine.anything());
373
-    });
374
-    it('should invoke the error callback function with error code 2', function(done) {
375
-      var a = {};
376
-      NativeStorage.setItem("dummy_ref_clear", a, function(result) {
377
-        expect(result).toEqual(a);
378
-        NativeStorage.clear(function(result) {
379
-          NativeStorage.getItem("dummy_ref_clear", function(result) {
380
-            fail("Should not give a result");
381
-          }, function(e) {
382
-            expect(e.code).toEqual(2);
383
-            done();
384
-          });
385
-        },
386
-          function(e) {
387
-            fail("Error when clearing native storage");
388
-          });
389
-      },
390
-        function(e) {
391
-          fail("Error when item is set");
392
-        });
393
-    });
394
-
395
-  });
396
-
397
-  describe('keys function', function() {
398
-    it("Plugin available", function() {
399
-      expect(NativeStorage).toEqual(jasmine.anything());
400
-    });
401
-    it('should return the keys', function(done) {
402
-      var a = {};
403
-      NativeStorage.setItem("dummy_ref_clear", a, function(result) {
404
-        expect(result).toEqual(a);
405
-        NativeStorage.keys(function(result) {
406
-            expect(result).toContain('dummy_ref_clear');
407
-            done();
408
-          },
409
-          function(e) {
410
-            fail("Error when listing keys in native storage");
411
-          });
412
-      },
413
-        function(e) {
414
-          fail("Error when item is set");
415
-        });
416
-    });
417
-  });
418
-};

+ 0
- 28
node_modules/cordova-plugin-nativestorage/tests/plugin.xml Datei anzeigen

@@ -1,28 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<!--
3
-  Licensed to the Apache Software Foundation (ASF) under one
4
-  or more contributor license agreements.  See the NOTICE file
5
-  distributed with this work for additional information
6
-  regarding copyright ownership.  The ASF licenses this file
7
-  to you under the Apache License, Version 2.0 (the
8
-  "License"); you may not use this file except in compliance
9
-  with the License.  You may obtain a copy of the License at
10
-    http://www.apache.org/licenses/LICENSE-2.0
11
-  Unless required by applicable law or agreed to in writing,
12
-  software distributed under the License is distributed on an
13
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
-  KIND, either express or implied.  See the License for the
15
-  specific language governing permissions and limitations
16
-  under the License.
17
--->
18
-
19
-<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
20
-    xmlns:android="http://schemas.android.com/apk/res/android"
21
-    id="cordova-plugin-nativestorage-tests"
22
-    version="2.0.0">
23
-    <name>Cordova NativeStorage Plugin Tests</name>
24
-    <license>Apache 2.0</license>
25
-    
26
-    <js-module src="main.js" name="tests">
27
-    </js-module>
28
-</plugin>

+ 0
- 42
node_modules/cordova-plugin-nativestorage/www/LocalStorageHandle.js Datei anzeigen

@@ -1,42 +0,0 @@
1
-var NativeStorageError = require('./NativeStorageError');
2
-
3
-// args = [reference, variable]
4
-function LocalStorageHandle(success, error, intent, operation, args) {
5
-    var reference = args[0];
6
-    var variable = args[1];
7
-
8
-    if (operation.startsWith('put') || operation.startsWith('set')) {
9
-        try {
10
-            var varAsString = JSON.stringify(variable);
11
-            if (reference === null) {
12
-                error(NativeStorageError.NULL_REFERENCE);
13
-                return;
14
-            }
15
-            localStorage.setItem(reference, varAsString);
16
-            success(variable);
17
-        } catch (err) {
18
-            error(NativeStorageError.JSON_ERROR);
19
-        }
20
-    } else if (operation.startsWith('get')) {
21
-        var item = {};
22
-        item = localStorage.getItem(reference);
23
-        if (item === null) {
24
-            error(NativeStorageError.ITEM_NOT_FOUND);
25
-            return;
26
-        }
27
-        try {
28
-            var obj = JSON.parse(item);
29
-            //console.log("LocalStorage Reading: "+obj);
30
-            success(obj);
31
-        } catch (err) {
32
-            error(NativeStorageError.JSON_ERROR);
33
-        }
34
-    } else if (operation === 'keys') {
35
-      var keys = [];
36
-      for(var i = 0; i < localStorage.length; i++){
37
-         keys.push(localStorage.key(i));
38
-      }
39
-      success(keys);
40
-    }
41
-}
42
-module.exports = LocalStorageHandle;

+ 0
- 23
node_modules/cordova-plugin-nativestorage/www/NativeStorageError.js Datei anzeigen

@@ -1,23 +0,0 @@
1
-/**
2
- * NativeStorageError
3
- * @constructor
4
- */
5
-var NativeStorageError = function(code, source, exception) {
6
-    this.code = code || null;
7
-    this.source = source || null;
8
-    this.exception = exception || null;
9
-};
10
-
11
-// Make NativeStorageError a real Error, you can test with `instanceof Error`
12
-NativeStorageError.prototype = Object.create(Error.prototype, {
13
-  constructor: { value: NativeStorageError }
14
-});
15
-
16
-NativeStorageError.NATIVE_WRITE_FAILED = 1;
17
-NativeStorageError.ITEM_NOT_FOUND = 2;
18
-NativeStorageError.NULL_REFERENCE = 3;
19
-NativeStorageError.UNDEFINED_TYPE = 4;
20
-NativeStorageError.JSON_ERROR = 5;
21
-NativeStorageError.WRONG_PARAMETER = 6;
22
-
23
-module.exports = NativeStorageError;

+ 0
- 517
node_modules/cordova-plugin-nativestorage/www/mainHandle.js Datei anzeigen

@@ -1,517 +0,0 @@
1
-var inBrowser = false;
2
-var NativeStorageError = require('./NativeStorageError');
3
-
4
-
5
-function isInBrowser() {
6
-  inBrowser = (window.cordova && (window.cordova.platformId === 'browser' || window.cordova.platformId === 'osx')) || !(window.phonegap || window.cordova);
7
-  return inBrowser;
8
-}
9
-
10
-function storageSupportAnalyse() {
11
-  if (!isInBrowser()) {
12
-    return 0;
13
-  //storageHandlerDelegate = exec;
14
-  } else {
15
-    if (window.localStorage) {
16
-      return 1;
17
-    //storageHandlerDelegate = localStorageHandle;
18
-    } else {
19
-      return 2;
20
-    //console.log("ALERT! localstorage isn't supported");
21
-    }
22
-  }
23
-}
24
-
25
-//if storage not available gracefully fails, no error message for now
26
-function StorageHandle() {
27
-  this.storageSupport = storageSupportAnalyse();
28
-  switch (this.storageSupport) {
29
-    case 0:
30
-      var exec = require('cordova/exec');
31
-      this.storageHandlerDelegate = exec;
32
-      break;
33
-    case 1:
34
-      var localStorageHandle = require('./LocalStorageHandle');
35
-      this.storageHandlerDelegate = localStorageHandle;
36
-      break;
37
-    case 2:
38
-      console.log("ALERT! localstorage isn't supported");
39
-      break;
40
-    default:
41
-      console.log("StorageSupport Error");
42
-      break;
43
-  }
44
-}
45
-
46
-StorageHandle.prototype.initWithSuiteName = function(suiteName, success, error) {
47
-  if (suiteName === null) {
48
-    error("Null suiteName isn't supported");
49
-    return;
50
-  }
51
-  this.storageHandlerDelegate(success, error, "NativeStorage", "initWithSuiteName", [suiteName]);
52
-};
53
-
54
-StorageHandle.prototype.set = function(reference, value, success, error) {
55
-
56
-  //if error is null then replace with empty function to silence warnings
57
-  if(!error){
58
-    error = function(){};
59
-  }
60
-
61
-  if (reference === null) {
62
-    error("The reference can't be null");
63
-    return;
64
-  }
65
-  if (value === null) {
66
-    error("a Null value isn't supported");
67
-    return;
68
-  }
69
-  switch (typeof value) {
70
-    case 'undefined':
71
-      error("an undefined type isn't supported");
72
-      break;
73
-    case 'boolean': {
74
-      this.putBoolean(reference, value, success, error);
75
-      break;
76
-    }
77
-    case 'number': {
78
-      // Good now check if it's a float or an int
79
-      if (value === +value) {
80
-        if (value === (value | 0)) {
81
-          // it's an int
82
-          this.putInt(reference, value, success, error);
83
-        } else if (value !== (value | 0)) {
84
-          this.putDouble(reference, value, success, error);
85
-        }
86
-      } else {
87
-        error("The value doesn't seem to be a number");
88
-      }
89
-      break;
90
-    }
91
-    case 'string': {
92
-      this.putString(reference, value, success, error);
93
-      break;
94
-    }
95
-    case 'object': {
96
-      this.putObject(reference, value, success, error);
97
-      break;
98
-    }
99
-    default:
100
-      error("The type isn't supported or isn't been recognized");
101
-      break;
102
-  }
103
-};
104
-
105
-/* removing */
106
-StorageHandle.prototype.remove = function(reference, success, error) {
107
-
108
-  //if error is null then replace with empty function to silence warnings
109
-  if(!error){
110
-    error = function(){};
111
-  }
112
-
113
-  if (reference === null) {
114
-    error("Null reference isn't supported");
115
-    return;
116
-  }
117
-
118
-  if (inBrowser) {
119
-    try {
120
-      localStorage.removeItem(reference);
121
-      success();
122
-    } catch (e) {
123
-      error(e);
124
-    }
125
-  } else {
126
-    this.storageHandlerDelegate(success, error, "NativeStorage", "remove", [reference]);
127
-  }
128
-};
129
-
130
-/* clearing */
131
-StorageHandle.prototype.clear = function(success, error) {
132
-
133
-  //if error is null then replace with empty function to silence warnings
134
-  if(!error){
135
-    error = function(){};
136
-  }
137
-
138
-  if (inBrowser) {
139
-    try {
140
-      localStorage.clear();
141
-      success();
142
-    } catch (e) {
143
-      error(e);
144
-    }
145
-  } else {
146
-    this.storageHandlerDelegate(success, error, "NativeStorage", "clear", []);
147
-  }
148
-};
149
-
150
-
151
-/* boolean storage */
152
-StorageHandle.prototype.putBoolean = function(reference, aBoolean, success, error) {
153
-
154
-  //if error is null then replace with empty function to silence warnings
155
-  if(!error){
156
-    error = function(){};
157
-  }
158
-
159
-  if (reference === null) {
160
-    error("Null reference isn't supported");
161
-    return;
162
-  }
163
-
164
-  if (aBoolean === null) {
165
-    error("a Null value isn't supported");
166
-    return;
167
-  }
168
-
169
-  if (typeof aBoolean === 'boolean') {
170
-    this.storageHandlerDelegate(function(returnedBool) {
171
-      if ('string' === typeof returnedBool) {
172
-        if ( (returnedBool === 'true') ) {
173
-          success(true);
174
-        } else if ( (returnedBool === 'false') ) {
175
-          success(false);
176
-        } else {
177
-          error("The returned boolean from SharedPreferences was not recognized: " + returnedBool);
178
-        }
179
-      } else {
180
-        success(returnedBool);
181
-      }
182
-    }, error, "NativeStorage", "putBoolean", [reference, aBoolean]);
183
-  } else {
184
-    error("Only boolean types are supported");
185
-  }
186
-};
187
-
188
-
189
-StorageHandle.prototype.getBoolean = function(reference, success, error) {
190
-
191
-  //if error is null then replace with empty function to silence warnings
192
-  if(!error){
193
-    error = function(){};
194
-  }
195
-
196
-  if (reference === null) {
197
-    error("Null reference isn't supported");
198
-    return;
199
-  }
200
-  this.storageHandlerDelegate(function(returnedBool) {
201
-    if ('string' === typeof returnedBool) {
202
-      if ( (returnedBool === 'true') ) {
203
-        success(true);
204
-      } else if ( (returnedBool === 'false') ) {
205
-        success(false);
206
-      } else {
207
-        error("The returned boolean from SharedPreferences was not recognized: " + returnedBool);
208
-      }
209
-    } else {
210
-      success(returnedBool);
211
-    }
212
-  }, error, "NativeStorage", "getBoolean", [reference]);
213
-};
214
-
215
-/* int storage */
216
-StorageHandle.prototype.putInt = function(reference, anInt, success, error) {
217
-
218
-  //if error is null then replace with empty function to silence warnings
219
-  if(!error){
220
-    error = function(){};
221
-  }
222
-
223
-  if (reference === null) {
224
-    error("Null reference isn't supported");
225
-    return;
226
-  }
227
-  this.storageHandlerDelegate(success, error, "NativeStorage", "putInt", [reference, anInt]);
228
-};
229
-
230
-StorageHandle.prototype.getInt = function(reference, success, error) {
231
-
232
-  //if error is null then replace with empty function to silence warnings
233
-  if(!error){
234
-    error = function(){};
235
-  }
236
-
237
-  if (reference === null) {
238
-    error("Null reference isn't supported");
239
-    return;
240
-  }
241
-  this.storageHandlerDelegate(success, error, "NativeStorage", "getInt", [reference]);
242
-};
243
-
244
-
245
-/* float storage */
246
-StorageHandle.prototype.putDouble = function(reference, aFloat, success, error) {
247
-
248
-  //if error is null then replace with empty function to silence warnings
249
-  if(!error){
250
-    error = function(){};
251
-  }
252
-
253
-  if (reference === null) {
254
-    error("Null reference isn't supported");
255
-    return;
256
-  }
257
-  this.storageHandlerDelegate(success, error, "NativeStorage", "putDouble", [reference, aFloat]);
258
-};
259
-
260
-StorageHandle.prototype.getDouble = function(reference, success, error) {
261
-
262
-  //if error is null then replace with empty function to silence warnings
263
-  if(!error){
264
-    error = function(){};
265
-  }
266
-
267
-  if (reference === null) {
268
-    error("Null reference isn't supported");
269
-    return;
270
-  }
271
-  this.storageHandlerDelegate(function(data) {
272
-    if (isNaN(data)) {
273
-      error('Expected double but got non-number');
274
-    } else {
275
-      success(parseFloat(data));
276
-    }
277
-  }, error, "NativeStorage", "getDouble", [reference]);
278
-};
279
-
280
-/* string storage */
281
-StorageHandle.prototype.putString = function(reference, s, success, error) {
282
-
283
-  //if error is null then replace with empty function to silence warnings
284
-  if(!error){
285
-    error = function(){};
286
-  }
287
-
288
-  if (reference === null) {
289
-    error("Null reference isn't supported");
290
-    return;
291
-  }
292
-  this.storageHandlerDelegate(success, error, "NativeStorage", "putString", [reference, s]);
293
-};
294
-
295
-StorageHandle.prototype.getString = function(reference, success, error) {
296
-
297
-  //if error is null then replace with empty function to silence warnings
298
-  if(!error){
299
-    error = function(){};
300
-  }
301
-
302
-  if (reference === null) {
303
-    error("Null reference isn't supported");
304
-    return;
305
-  }
306
-  this.storageHandlerDelegate(success, error, "NativeStorage", "getString", [reference]);
307
-};
308
-
309
-/* object storage  COMPOSITE AND DOESNT CARE FOR BROWSER*/
310
-StorageHandle.prototype.putObject = function(reference, obj, success, error) {
311
-
312
-  //if error is null then replace with empty function to silence warnings
313
-  if(!error){
314
-    error = function(){};
315
-  }
316
-
317
-  var objAsString = "";
318
-  try {
319
-    objAsString = JSON.stringify(obj);
320
-  } catch (err) {
321
-    error(err);
322
-  }
323
-  this.putString(reference, objAsString, function(data) {
324
-    var obj = {};
325
-    try {
326
-      obj = JSON.parse(data);
327
-      success(obj);
328
-    } catch (err) {
329
-      error(err);
330
-    }
331
-  }, error);
332
-};
333
-
334
-StorageHandle.prototype.getObject = function(reference, success, error) {
335
-
336
-  //if error is null then replace with empty function to silence warnings
337
-  if(!error){
338
-    error = function(){};
339
-  }
340
-
341
-  this.getString(reference, function(data) {
342
-    var obj = {};
343
-    try {
344
-      obj = JSON.parse(data);
345
-      success(obj);
346
-    } catch (err) {
347
-      error(err);
348
-    }
349
-  }, error);
350
-};
351
-
352
-/* API >= 2 */
353
-StorageHandle.prototype.setItem = function(reference, obj, success, error) {
354
-
355
-  //if error is null then replace with empty function to silence warnings
356
-  if(!error){
357
-    error = function(){};
358
-  }
359
-
360
-  var objAsString = "";
361
-  try {
362
-    objAsString = JSON.stringify(obj);
363
-  } catch (err) {
364
-    error(new NativeStorageError(NativeStorageError.JSON_ERROR, "JS", err));
365
-    return;
366
-  }
367
-  if (reference === null) {
368
-    error(new NativeStorageError(NativeStorageError.NULL_REFERENCE, "JS", ""));
369
-    return;
370
-  }
371
-  this.storageHandlerDelegate(function(data) {
372
-    try {
373
-      obj = JSON.parse(data);
374
-      success(obj);
375
-    } catch (err) {
376
-      error(new NativeStorageError(NativeStorageError.JSON_ERROR, "JS", err));
377
-    }
378
-  }, function(code) {
379
-    error(new NativeStorageError(code, "Native", ""));
380
-  }, "NativeStorage", "setItem", [reference, objAsString]);
381
-};
382
-
383
-StorageHandle.prototype.getItem = function(reference, success, error) {
384
-
385
-  //if error is null then replace with empty function to silence warnings
386
-  if(!error){
387
-    error = function(){};
388
-  }
389
-
390
-  if (reference === null) {
391
-    error(new NativeStorageError(NativeStorageError.NULL_REFERENCE, "JS", ""));
392
-    return;
393
-  }
394
-  var obj = {};
395
-
396
-  this.storageHandlerDelegate(
397
-    function(data) {
398
-      try {
399
-        obj = JSON.parse(data);
400
-        success(obj);
401
-      } catch (err) {
402
-        error(new NativeStorageError(NativeStorageError.JSON_ERROR, "JS", err));
403
-      }
404
-    },
405
-    function(code) {
406
-      error(new NativeStorageError(code, "Native", ""));
407
-    }, "NativeStorage", "getItem", [reference]);
408
-};
409
-
410
-/* API >= 2 */
411
-StorageHandle.prototype.setSecretItem = function(reference, obj, encryptConfig, success, error) {
412
-
413
-  //if error is null then replace with empty function to silence warnings
414
-  if(!error){
415
-    error = function(){};
416
-  }
417
-
418
-  var objAsString = "";
419
-  try {
420
-    objAsString = JSON.stringify(obj);
421
-  } catch (err) {
422
-    error(new NativeStorageError(NativeStorageError.JSON_ERROR, "JS", err));
423
-    return;
424
-  }
425
-  if (reference === null) {
426
-    error(new NativeStorageError(NativeStorageError.NULL_REFERENCE, "JS", ""));
427
-    return;
428
-  }
429
-
430
-  var action = "setItem";
431
-  var params = [reference, objAsString];
432
-  switch (encryptConfig.mode) {
433
-    case "password":
434
-      action = "setItemWithPassword";
435
-      params = [reference, objAsString, encryptConfig.value];
436
-      break;
437
-    case "key":
438
-      action = "setItemWithKey";
439
-      break;
440
-    case "none":
441
-      break;
442
-    default: {
443
-      error(new NativeStorageError(NativeStorageError.WRONG_PARAMETER, "JS", ""));
444
-      return;
445
-    }
446
-  }
447
-  this.storageHandlerDelegate(function(data) {
448
-    try {
449
-      obj = JSON.parse(data);
450
-      success(obj);
451
-    } catch (err) {
452
-      error(new NativeStorageError(NativeStorageError.JSON_ERROR, "JS", err));
453
-    }
454
-  }, function(code) {
455
-    error(new NativeStorageError(code, "Native", ""));
456
-  }, "NativeStorage", action, params);
457
-};
458
-
459
-StorageHandle.prototype.getSecretItem = function(reference, encryptConfig, success, error) {
460
-
461
-  //if error is null then replace with empty function to silence warnings
462
-  if(!error){
463
-    error = function(){};
464
-  }
465
-
466
-  if (reference === null) {
467
-    error(new NativeStorageError(NativeStorageError.NULL_REFERENCE, "JS", ""));
468
-    return;
469
-  }
470
-  var obj = {};
471
-
472
-  var action = "getItem";
473
-  var params = [reference];
474
-  switch (encryptConfig.mode) {
475
-    case "password":
476
-      action = "getItemWithPassword";
477
-      params = [reference, encryptConfig.value];
478
-      break;
479
-    case "key":
480
-      action = "getItemWithKey";
481
-      break;
482
-    case "none":
483
-      break;
484
-    default: {
485
-      error(new NativeStorageError(NativeStorageError.WRONG_PARAMETER, "JS", ""));
486
-      return;
487
-    }
488
-  }
489
-
490
-  this.storageHandlerDelegate(
491
-    function(data) {
492
-      try {
493
-        obj = JSON.parse(data);
494
-        success(obj);
495
-      } catch (err) {
496
-        error(new NativeStorageError(NativeStorageError.JSON_ERROR, "JS", err));
497
-      }
498
-    },
499
-    function(code) {
500
-      error(new NativeStorageError(code, "Native", ""));
501
-    }, "NativeStorage", action, params);
502
-};
503
-
504
-/* list keys */
505
-StorageHandle.prototype.keys = function(success, error) {
506
-
507
-  //if error is null then replace with empty function to silence warnings
508
-  if(!error){
509
-    error = function(){};
510
-  }
511
-
512
-  this.storageHandlerDelegate(success, error, "NativeStorage", "keys", []);
513
-};
514
-
515
-
516
-var storageHandle = new StorageHandle();
517
-module.exports = storageHandle;

+ 0
- 31
node_modules/cordova-sqlite-storage-dependencies/README.md Datei anzeigen

@@ -1,31 +0,0 @@
1
-# Cordova sqlite storage dependencies
2
-
3
-**AUTHOR:** Christopher J. Brody
4
-
5
-**LICENSE:** MIT (for `sql-asm-memory-growth.js` built from fork of [kripken / sql.js](https://github.com/kripken/sql.js)); public domain for other artifacts
6
-
7
-Contains source and object code built from:
8
-- [storesafe / sql.js](https://github.com/storesafe/sql.js) - fork of [kripken / sql.js](https://github.com/kripken/sql.js) (MIT license)
9
-- SQLite3 from [sqlite.org](http://sqlite.org/) (public domain)
10
-- [liteglue / Android-sqlite-connector](https://github.com/liteglue/Android-sqlite-connector) (Unlicense, public domain)
11
-- [brodybits / Android-sqlite-ext-native-driver (sqlite-storage-native-driver branch)](https://github.com/brodybits/Android-sqlite-ext-native-driver/tree/sqlite-storage-native-driver) (Unlicense, public domain)
12
-
13
-This project provides the following dependencies needed to build [storesafe / cordova-sqlite-storage](https://github.com/storesafe/cordova-sqlite-storage):
14
-- `sql-asm-memory-growth.js` - built from [storesafe / sql.js](https://github.com/storesafe/sql.js) (fork of [kripken / sql.js](https://github.com/kripken/sql.js)) with SQLite `3.22.3` for `browser` platform
15
-- `sqlite3.h`, `sqlite3.c` - SQLite `3.32.3` amalgamation needed to build iOS/macOS and Windows versions
16
-- `libs` - [liteglue / Android-sqlite-connector](https://github.com/liteglue/Android-sqlite-connector) and [brodybits / Android-sqlite-ext-native-driver (sqlite-storage-native-driver branch)](https://github.com/brodybits/Android-sqlite-ext-native-driver/tree/sqlite-storage-native-driver) JAR libraries built with SQLite `3.32.3` amalgamation, with the following flags:
17
-  - `-DSQLITE_THREADSAFE=1`
18
-  - `-DSQLITE_DEFAULT_SYNCHRONOUS=3`
19
-  - `-DSQLITE_DEFAULT_MEMSTATUS=0`
20
-  - `-DSQLITE_OMIT_DECLTYPE`
21
-  - `-DSQLITE_OMIT_DEPRECATED`
22
-  - `-DSQLITE_OMIT_PROGRESS_CALLBACK`
23
-  - `-DSQLITE_OMIT_SHARED_CACHE`
24
-  - `-DSQLITE_TEMP_STORE=2`
25
-  - `-DSQLITE_OMIT_LOAD_EXTENSION`
26
-  - `-DSQLITE_ENABLE_FTS3`
27
-  - `-DSQLITE_ENABLE_FTS3_PARENTHESIS`
28
-  - `-DSQLITE_ENABLE_FTS4`
29
-  - `-DSQLITE_ENABLE_RTREE`
30
-  - `-DSQLITE_DEFAULT_PAGE_SIZE=4096`
31
-  - `-DSQLITE_DEFAULT_CACHE_SIZE=-2000`

BIN
node_modules/cordova-sqlite-storage-dependencies/libs/sqlite-connector.jar Datei anzeigen


BIN
node_modules/cordova-sqlite-storage-dependencies/libs/sqlite-native-driver.jar Datei anzeigen


+ 0
- 51
node_modules/cordova-sqlite-storage-dependencies/package.json Datei anzeigen

@@ -1,51 +0,0 @@
1
-{
2
-  "_from": "cordova-sqlite-storage-dependencies@3.0.0",
3
-  "_id": "cordova-sqlite-storage-dependencies@3.0.0",
4
-  "_inBundle": false,
5
-  "_integrity": "sha512-A7gV5lQZc0oPrJ/a+lsZmMZr7vYou4MXyQFOY+b/dwuCMsagLT0EsL7oY54tqzpvjtzLfh0aZGGm9i8DMAIFSA==",
6
-  "_location": "/cordova-sqlite-storage-dependencies",
7
-  "_phantomChildren": {},
8
-  "_requested": {
9
-    "type": "version",
10
-    "registry": true,
11
-    "raw": "cordova-sqlite-storage-dependencies@3.0.0",
12
-    "name": "cordova-sqlite-storage-dependencies",
13
-    "escapedName": "cordova-sqlite-storage-dependencies",
14
-    "rawSpec": "3.0.0",
15
-    "saveSpec": null,
16
-    "fetchSpec": "3.0.0"
17
-  },
18
-  "_requiredBy": [
19
-    "/cordova-sqlite-storage"
20
-  ],
21
-  "_resolved": "https://registry.npmjs.org/cordova-sqlite-storage-dependencies/-/cordova-sqlite-storage-dependencies-3.0.0.tgz",
22
-  "_shasum": "5f9c9fd6342fd4135a3375cc3d5579ffd0318e25",
23
-  "_spec": "cordova-sqlite-storage-dependencies@3.0.0",
24
-  "_where": "/Users/christian/Documents/artesanias/node_modules/cordova-sqlite-storage",
25
-  "author": {
26
-    "name": "Christopher J. Brody"
27
-  },
28
-  "bugs": {
29
-    "url": "https://github.com/litehelpers/Cordova-sqlite-storage-dependencies/issues"
30
-  },
31
-  "bundleDependencies": false,
32
-  "deprecated": false,
33
-  "description": "Cordova sqlite storage dependencies",
34
-  "homepage": "https://github.com/litehelpers/Cordova-sqlite-storage-dependencies#readme",
35
-  "keywords": [
36
-    "cordova",
37
-    "sqlite",
38
-    "amalgamation"
39
-  ],
40
-  "license": "MIT",
41
-  "main": "404.js",
42
-  "name": "cordova-sqlite-storage-dependencies",
43
-  "repository": {
44
-    "type": "git",
45
-    "url": "git+https://github.com/litehelpers/Cordova-sqlite-storage-dependencies.git"
46
-  },
47
-  "scripts": {
48
-    "test": "echo \"Error: no test specified\" && exit 1"
49
-  },
50
-  "version": "3.0.0"
51
-}

+ 0
- 268
node_modules/cordova-sqlite-storage-dependencies/sql-asm-memory-growth.js
Datei-Diff unterdrückt, da er zu groß ist
Datei anzeigen


+ 0
- 229787
node_modules/cordova-sqlite-storage-dependencies/sqlite3.c
Datei-Diff unterdrückt, da er zu groß ist
Datei anzeigen


+ 0
- 12168
node_modules/cordova-sqlite-storage-dependencies/sqlite3.h
Datei-Diff unterdrückt, da er zu groß ist
Datei anzeigen


+ 0
- 29
node_modules/cordova-sqlite-storage/.travis.yml Datei anzeigen

@@ -1,29 +0,0 @@
1
-language: objective-c
2
-
3
-env:
4
-  global:
5
-    - SPEC_WWW_DIR=${TRAVIS_BUILD_DIR}/spec/www
6
-    - TESTS_PATH=${TRAVIS_BUILD_DIR}/tests/tests.js
7
-    - CORDOVA_PARAMEDIC_CMD="cordova-paramedic --platform ios --plugin ${TRAVIS_BUILD_DIR} --timeout 3600000"
8
-
9
-git:
10
-  depth: 2
11
-
12
-node_js:
13
-  - "4.6"
14
-
15
-install:
16
-  - echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
17
-  - npm install -g cordova-paramedic
18
-  - npm install -g cordova
19
-  - npm install -g ios-sim
20
-
21
-script:
22
-  - date && cordova-paramedic --platform ios --plugin ${TRAVIS_BUILD_DIR} || echo error-ignored
23
-  - date && cp ${SPEC_WWW_DIR}/spec/self-test.js ${TESTS_PATH} && ${CORDOVA_PARAMEDIC_CMD}
24
-  - date && cp ${SPEC_WWW_DIR}/spec/db-tx-string-test.js ${TESTS_PATH} && ${CORDOVA_PARAMEDIC_CMD}
25
-  - date && cp ${SPEC_WWW_DIR}/spec/db-tx-sql-select-value-test.js ${TESTS_PATH} && ${CORDOVA_PARAMEDIC_CMD}
26
-  - date && cp ${SPEC_WWW_DIR}/spec/basic-db-tx-sql-storage-results.js ${TESTS_PATH} && ${CORDOVA_PARAMEDIC_CMD}
27
-  - date && cp ${SPEC_WWW_DIR}/spec/db-sql-operations-test.js ${TESTS_PATH} && ${CORDOVA_PARAMEDIC_CMD}
28
-  - date && cp ${SPEC_WWW_DIR}/spec/sql-batch-test.js ${TESTS_PATH} && ${CORDOVA_PARAMEDIC_CMD}
29
-  - date

+ 0
- 34
node_modules/cordova-sqlite-storage/AUTHORS.md Datei anzeigen

@@ -1,34 +0,0 @@
1
-# Authors
2
-
3
-## Common Javascript
4
-
5
-- Extracted from DroidGap by @brodybits (Christopher J. Brody aka Chris Brody)
6
-- Fail-safe nested transaction support by @ef4 (Edward Faulkner)
7
-- Translated to Coffee-Script using js2coffee tool by @brodybits (Chris Brody)
8
-- API changes by @brodybits (Chris Brody)
9
-- Transaction timing fixes to support PouchDB by @nolanlawson
10
-
11
-## browser platform
12
-
13
-- Using sql-asm-memory-growth.js built from sql.js by @kripken (Alon Zakai)
14
-
15
-## Android version
16
-
17
-- Extracted from DroidGap by @brodybits (Chris Brody)
18
-- Transaction batch processing of Android version by @marcucio
19
-- Maintained by @brodybits (Chris Brody)
20
-- Fixes to support old Android versions by @nolanlawson
21
-- Thanks to Mark Oppenheim <mark.oppenheim@mnetics.co.uk> for fixes to open/close callbacks and repeated open/close/delete operations
22
-
23
-## iOS/macOS version
24
-
25
-- Original authors: @davibe (Davide Bertola <dade@dadeb.it>) and @joenoon (Joe Noon <joenoon@gmail.com>)
26
-- Cordova 2.7+ port with background processing by @j3k0 (Jean-Christophe Hoelt <hoelt@fovea.cc>)
27
-- Maintained by @brodybits (Chris Brody)
28
-
29
-## Windows version
30
-
31
-- SQLiteProxy.js by @vldmrrr (Vladimir Avdonin) and @brodybits (Chris Brody)
32
-- Using SQLite3-WinRT C++ classes and SQLite3JS (Javascript part) by @doo (doo GmbH)
33
-- Visual C++ build files for Windows 8.1, Windows Phone 8.1, and Windows 10 UWP by @brodybits (with some help from Visual Studio Express 2013)
34
-- Thanks to @AllJoyn-Cordova for idea how to integrate Windows 8.1/Windows Phone 8.1 Visual C++ projects in plugin.xml

+ 0
- 489
node_modules/cordova-sqlite-storage/CHANGES.md Datei anzeigen

@@ -1,489 +0,0 @@
1
-# Changes
2
-
3
-#### cordova-sqlite-storage 5.1.0
4
-
5
-- Add browser platform support using sql-asm-memory-growth.js from sql.js, with some limitations as documented
6
-
7
-#### cordova-sqlite-storage 5.0.1
8
-
9
-- enable RENAME table with view test - from December 2019 SQLite crash report, fixed in 2020 ref:
10
-  - http://sqlite.1065341.n5.nabble.com/Crash-Bug-Report-tc109903.html
11
-  - https://github.com/xpbrew/cordova-sqlite-storage/issues/904
12
-- SQLite 3.32.3 update from cordova-sqlite-storage-dependencies@2.1.2
13
-
14
-#### cordova-sqlite-storage 5.0.0
15
-
16
-- avoid incorrect default directory on iOS/macOS - to be extra safe (see <https://github.com/xpbrew/cordova-sqlite-storage/issues/907>)
17
-  - ensure that default "nosync" directory *always* has resource value set for `NSURLIsExcludedFromBackupKey`
18
-  - add more checks for missing database directory
19
-
20
-#### cordova-sqlite-storage 4.0.0
21
-
22
-- rename PSPDFThreadSafeMutableDictionary to CustomPSPDFThreadSafeMutableDictionary and completely remove PSPDFThreadSafeMutableDictionary.h
23
-
24
-#### cordova-sqlite-storage 3.4.1
25
-
26
-- SQLite 3.30.1 update from cordova-sqlite-storage-dependencies@2.1.1
27
-
28
-#### cordova-sqlite-storage 3.4.0
29
-
30
-- quick workaround for `SYNTAX_ERR` redefinition
31
-
32
-#### cordova-sqlite-storage 3.3.0
33
-
34
-- new default page & cache sizes with cordova-sqlite-storage-dependencies@2.1.0
35
-
36
-##### cordova-sqlite-storage-commoncore 1.0.0
37
-
38
-- additional EU string manipulation test cases
39
-
40
-#### cordova-sqlite-storage 3.2.1
41
-
42
-- cordova-sqlite-storage-dependencies@2.0.1 with SQLite 3.28.0 update for all supported platforms Android/iOS/macOS/Windows
43
-
44
-#### cordova-sqlite-storage 3.2.0
45
-
46
-- sqlite3_threadsafe() error handling on iOS/macOS
47
-
48
-#### cordova-sqlite-storage 3.1.0
49
-
50
-- no SQLITE_DEFAULT_CACHE_SIZE compile-time setting on iOS/macOS/Windows
51
-
52
-#### cordova-sqlite-storage 3.0.0
53
-
54
-- Use cordova-sqlite-storage-dependencies 2.0.0 with SQLITE_DBCONFIG_DEFENSIVE setting used by sqlite-native-driver.jar on Android
55
-
56
-###### cordova-sqlite-ext-common-core 0.2.0
57
-
58
-- Move SQLite3.UWP.vcxproj out of extra SQLite3.UWP subdirectory
59
-- Completely remove old Windows 8.1 & Windows Phone 8.1 vcxproj files
60
-
61
-###### cordova-sqlite-extcore 0.1.0
62
-
63
-- move the embedded `SQLite3-WinRT` component to `src/windows/SQLite3-WinRT-sync` and update `plugin.xml`
64
-
65
-##### cordova-sqlite-ext-common-core 0.1.0
66
-
67
-###### cordova-sqlite-ext-core-common 0.1.0
68
-
69
-- beforePluginInstall.js updates
70
-  - use standard Promise
71
-  - get the plugin package name from package.json
72
-  - use const instead of var (this should be considered a POSSIBLY BREAKING CHANGE since const may not work on some really old Node.js versions)
73
-  - remove hasbang line that is not needed
74
-
75
-###### cordova-sqlite-storage-ext-core-common 2.0.0
76
-
77
-- SQLITE_DBCONFIG_DEFENSIVE flag - iOS/macOS/Windows (POTENTIALLY BREAKING CHANGE)
78
-- remove internal qid usage from JavaScript (not needed)
79
-- non-static Android database runner map (POTENTIALLY BREAKING CHANGE)
80
-- Completely remove old Android SuppressLint (android.annotation.SuppressLint) - POSSIBLY BREAKING CHANGE
81
-- drop workaround for pre-Honeycomb Android API (BREAKING CHANGE)
82
-- no extra @synchronized block per batch (iOS/macOS) - should be considered a POSSIBLY BREAKING change
83
-- remove backgroundExecuteSql method not needed (iOS/macOS)
84
-- Completely remove iOS/macOS MRC (Manual Reference Counting) support - should be considered a POSSIBLY BREAKING change
85
-
86
-### cordova-sqlite-storage 2.6.0
87
-
88
-- Use cordova-sqlite-storage-dependencies 1.2.1 with SQLite 3.26.0, with a security update and support for window functions
89
-
90
-### cordova-sqlite-storage 2.5.2
91
-
92
-- Ignore Android end transaction error when closing for androidDatabaseProvider: 'system' setting, to avoid possible crash during app shutdown (<https://github.com/litehelpers/Cordova-sqlite-storage/issues/833>)
93
-
94
-### cordova-sqlite-storage 2.5.1
95
-
96
-- fix internal plugin cleanup error log on Android
97
-
98
-### cordova-sqlite-storage 2.5.0
99
-
100
-- androidDatabaseProvider: 'system' setting, to replace androidDatabaseImplementation setting which is now deprecated
101
-
102
-### cordova-sqlite-storage 2.4.0
103
-
104
-- Report internal plugin error in case of attempt to open database with no database name on iOS or macOS
105
-- Cover use of standard (WebKit) Web SQL API in spec test suite
106
-- Test and document insertId in UPDATE result set on plugin vs (WebKit) Web SQL
107
-- other test updates
108
-
109
-### cordova-sqlite-storage 2.3.3
110
-
111
-- Quick fix for some iOS/macOS internal plugin error log messagess
112
-- test updates
113
-- quick doc updates
114
-
115
-### cordova-sqlite-storage 2.3.2
116
-
117
-- Mark some Android errors as internal plugin errors (quick fix)
118
-- remove trailing whitespace from Android implementation
119
-- test coverage updates
120
-- quick doc updates
121
-
122
-### cordova-sqlite-storage 2.3.1
123
-
124
-- Mark some iOS/macOS plugin error messages as internal plugin errors (quick fix)
125
-- Quick documentation updates
126
-
127
-### cordova-sqlite-storage 2.3.0
128
-
129
-- Use SQLite 3.22.0 with SQLITE_DEFAULT_SYNCHRONOUS=3 (EXTRA DURABLE) compile-time setting on all platforms (Android/iOS/macOS/Windows) ref: litehelpers/Cordova-sqlite-storage#736
130
-
131
-### cordova-sqlite-storage 2.2.1
132
-
133
-- SQLITE_THREADSAFE=1 compile-time setting for iOS/macOS
134
-- Fix Android/iOS src copyright, perpetually
135
-
136
-## cordova-sqlite-storage 2.2.0
137
-
138
-- Android-sqlite-native-driver NDK objects in JAR to resolve issue on cordova-android@7
139
-- Fix SQLiteAndroidDatabase implementation for Turkish and other foreign locales
140
-
141
-## cordova-sqlite-storage 2.1.5
142
-
143
-##### cordova-sqlite-legacy-core 1.0.7
144
-
145
-- Add error info text in case of close error on Windows
146
-- Signal INTERNAL ERROR in case of attempt to reuse db on Windows (should never happen due to workaround solution to BUG 666)
147
-- SQLITE_DEFAULT_CACHE_SIZE build flag fix for macOS ("osx") and Windows
148
-
149
-###### cordova-sqlite-legacy-express-core 1.0.5
150
-
151
-- iOS/macOS @synchronized guard for sqlite3_open operation
152
-- Signal INTERNAL ERROR in case of attempt to reuse db (Android/iOS) (should never happen due to workaround solution to BUG 666)
153
-
154
-## cordova-sqlite-storage 2.1.4
155
-
156
-##### cordova-sqlite-legacy-core 1.0.6
157
-
158
-###### cordova-sqlite-legacy-express-core 1.0.4
159
-
160
-- Cleaned up workaround solution to BUG 666: close db before opening (ignore close error)
161
-- android.database end transaction if active before closing (needed for new BUG 666 workaround solution to pass selfTest in case of builtin android.database implementation)
162
-
163
-## cordova-sqlite-storage 2.1.3
164
-
165
-##### cordova-sqlite-legacy-core 1.0.5
166
-
167
-###### cordova-sqlite-legacy-express-core 1.0.3
168
-
169
-- Resolve Java 6/7/8 concurrent map compatibility issue reported in litehelpers/Cordova-sqlite-storage#726, THANKS to pointer by @NeoLSN (Jason Yang/楊朝傑) in litehelpers/Cordova-sqlite-storage#727.
170
-- selfTest database cleanup do not ignore close or delete error on any platforms
171
-
172
-## cordova-sqlite-storage 2.1.2
173
-
174
-##### cordova-sqlite-legacy-core 1.0.4
175
-
176
-- New workaround solution to BUG 666: close db before opening (ignore close error)
177
-
178
-## cordova-sqlite-storage 2.1.1
179
-
180
-##### cordova-sqlite-legacy-core 1.0.3
181
-
182
-- Suppress warnings when building sqlite3.c & PSPDFThreadSafeMutableDictionary.m on iOS/macOS
183
-
184
-##### cordova-sqlite-legacy-core 1.0.2
185
-
186
-- Fix log in case of transaction waiting for open to finish; doc fixes
187
-- SQLite 3.15.2 build with SQLITE_THREADSAFE=2 on iOS/macOS (SQLITE_THREADSAFE=1 on Android/Windows) and other flag fixes in this version branch to avoid possible malformed database due to multithreaded access ref: litehelpers/Cordova-sqlite-storage#703
188
-- Windows 10 (UWP) build with /SAFESEH flag on Win32 (x86) target
189
-
190
-###### cordova-sqlite-legacy-express-core 1.0.2
191
-
192
-- Use PSPDFThreadSafeMutableDictionary for iOS/macOS to avoid threading issue ref: litehelpers/Cordova-sqlite-storage#716
193
-
194
-###### cordova-sqlite-legacy-express-core 1.0.1
195
-
196
-- Fix bug 666 workaround to trigger ROLLBACK in the next event tick (needed to support version with pre-populated database on Windows)
197
-
198
-## cordova-sqlite-storage 2.1.0
199
-
200
-- Visual Studio 2017 updates for Windows UWP build
201
-
202
-## cordova-sqlite-storage 2.0.4
203
-
204
-###### cordova-sqlite-legacy-express-core 1.0.0
205
-
206
-- Workaround solution to BUG litehelpers/Cordova-sqlite-storage#666 (hanging transaction in case of location reload/change)
207
-- selfTest simulate scenario & test solution to BUG litehelpers/Cordova-sqlite-storage#666 (also includes string test and test of effects of location reload/change in this version branch, along with another internal check)
208
-
209
-## cordova-sqlite-storage 2.0.3
210
-
211
-- Drop engines rule from package.json
212
-- Doc fixes
213
-
214
-### cordova-sqlite-storage 1.5.4
215
-
216
-- Fix iOS/macOS version to report undefined insertId in case INSERT OR IGNORE is ignored
217
-- Fix FIRST_WORD check for android.sqlite.database implementation
218
-- SQLite 3.15.2 build fixes
219
-- Doc updates
220
-
221
-## cordova-sqlite-storage 2.0.2
222
-
223
-- Fix Windows target platform version
224
-
225
-### cordova-sqlite-storage 1.5.3
226
-
227
-- Fix merges to prevent possible conflicts with other plugins (Windows)
228
-- Fix handling of undefined SQL argument values (Windows)
229
-- Signal error in case of a failure opening the database file (iOS/macOS)
230
-- Doc fixes and updates
231
-
232
-## cordova-sqlite-storage 2.0.1
233
-
234
-### cordova-sqlite-storage 1.5.2
235
-
236
-- Build with sqlite 3.15.2 with the following settings in this version branch:
237
-  - SQLITE_TEMP_STORE=2
238
-  - SQLITE_THREADSAFE=1
239
-  - SQLITE_ENABLE_FTS3
240
-  - SQLITE_ENABLE_FTS3_PARENTHESIS
241
-  - SQLITE_ENABLE_FTS4
242
-  - SQLITE_ENABLE_RTREE
243
-  - SQLITE_OMIT_BUILTIN_TEST
244
-  - SQLITE_OMIT_LOAD_EXTENSION
245
-  - SQLITE_DEFAULT_PAGE_SIZE=1024 and SQLITE_DEFAULT_CACHE_SIZE=2000 to avoid "potentially distruptive change(s)" from SQLite 3.12.0 ref: <http://sqlite.org/pgszchng2016.html>
246
-  - SQLITE_OS_WINRT for Windows only
247
-- Check transaction callback functions to avoid crash on Windows
248
-- Fix echoTest callback handling
249
-- Fix openDatabase/deleteDatabase exception messages
250
-- Move Lawnchair adapter to a separate project
251
-- Doc updates
252
-
253
-### cordova-sqlite-storage 2.0.0
254
-
255
-- Reference Windows platform toolset v141 to support Visual Studio 2017 (RC)
256
-
257
-### cordova-sqlite-storage 1.5.1
258
-
259
-- Add engines rule to package.json to specify plugin version >= 2.0.0 in case of cordova-windows 4.4.2 or newer for Visual Studio 2017 (Preview)
260
-
261
-### cordova-sqlite-storage 1.5.0
262
-
263
-- Build with sqlite 3.15.1, with the following settings:
264
-  - SQLITE_TEMP_STORE=2
265
-  - SQLITE_THREADSAFE=2
266
-  - FTS3, FTS4, and R-Tree enabled
267
-  - SQLITE_DEFAULT_PAGE_SIZE=1024 and SQLITE_DEFAULT_CACHE_SIZE=2000 to avoid "potentially distruptive change(s)" from SQLite 3.12.0 ref: <http://sqlite.org/pgszchng2016.html>
268
-- Drop support for Windows 8.1 & Windows Phone 8.1
269
-
270
-### cordova-sqlite-storage 1.4.9
271
-
272
-- Minor JavaScript fix (generated by CoffeeScript 1.11.1)
273
-- Update test due to issue with u2028/u2029 on cordova-android 6.0.0
274
-- doc fixes
275
-- Cleanup plugin.xml: remove old engine constraint that was already commented out
276
-- Fix LICENSE.md
277
-
278
-### cordova-sqlite-storage 1.4.8
279
-
280
-- selfTest function add string test and test of effects of location reload/change
281
-- Support macOS ("osx" platform)
282
-- Signal an error in case of SQL with too many parameter argument values on iOS (in addition to Android & Windows)
283
-- Include proper SQL error code on Android (in certain cases)
284
-- Fix reporting of SQL statement execution errors in Windows version
285
-- Fix Windows version to report errors with a valid error code (0)
286
-- Some doc fixes
287
-
288
-### cordova-sqlite-storage 1.4.7
289
-
290
-- Minor JavaScript fixes to pass @brodybits/Cordova-sql-test-app
291
-
292
-### cordova-sqlite-storage 1.4.6
293
-
294
-- Stop remaining transaction callback in case of an error with no error handler returning false
295
-- Expand selfTest function to cover CRUD with unique record keys
296
-- Fix readTransaction to reject ALTER, REINDEX, and REPLACE operations
297
-- Fix Windows 10 ARM Release Build of SQLite3 by disabling SDL check (ARM Release only)
298
-- Fix Windows 8.1/Windows Phone 8.1 Release Build of SQLite3 by disabling SDL check
299
-- Some documentation fixes
300
-
301
-### cordova-sqlite-storage 1.4.5
302
-
303
-- Log/error message fixes; remove extra qid from internal JSON interface
304
-
305
-### cordova-sqlite-storage 1.4.4
306
-
307
-- Fix readTransaction to reject modification statements with extra semicolon(s) in the beginning
308
-- Announce new Cordova-sqlite-evcore-extbuild-free version
309
-- Additional tests
310
-- Other doc fixes
311
-
312
-### cordova-sqlite-storage 1.4.3
313
-
314
-- Handle executeSql with object sql value (solves another possible crash on iOS)
315
-
316
-### cordova-sqlite-storage 1.4.2
317
-
318
-- Fix sqlitePlugin.openDatabase and sqlitePlugin.deleteDatabase to check location/iosDatabaseLocation values
319
-- Fix sqlitePlugin.deleteDatabase to check that db name is really a string (prevents possible crash on iOS)
320
-- Fix iOS version to use DLog macro to remove extra logging from release build
321
-- Fix Lawnchair adapter to use new mandatory "location" parameter
322
-- Remove special handling of Blob parameters, use toString for all non-value parameter objects
323
-- Minor cleanup of Android version code
324
-
325
-### cordova-sqlite-storage 1.4.1
326
-
327
-- Minimum Cordova version no longer enforced in this version
328
-
329
-### cordova-sqlite-storage 1.4.0
330
-
331
-- Now using cordova-sqlite-storage-dependencies for SQLite 3.8.10.2 Android/iOS/Windows
332
-- Android-sqlite-connector implementation supported by this version again
333
-- Enforce minimum cordova-windows version (should be OK in Cordova 6.x)
334
-- Support Windows 10 along with Windows 8.1/Windows Phone 8.1
335
-
336
-### cordova-sqlite-storage 1.2.2
337
-
338
-- Self-test function to verify ability to open/populate/read/delete a test database
339
-- Read BLOB as Base-64 DISABLED in Android version (was already disabled for iOS)
340
-
341
-### cordova-sqlite-storage 1.2.1
342
-
343
-- Close Android SQLiteStatement after INSERT/UPDATE/DELETE
344
-- Specify minimum Cordova version 6.0.0
345
-- Lawnchair adapter fix: Changed remove method to work with key array
346
-
347
-### cordova-sqlite-storage 1.2.0
348
-
349
-- Rename Lawnchair adapter to prevent clash with standard webkit-sqlite adapter
350
-- Support location: 'default' setting in openDatabase & deleteDatabase
351
-
352
-### cordova-sqlite-storage 0.8.5
353
-
354
-- More explicit iosDatabaseLocation option
355
-- iOS database location is now mandatory
356
-- Split-up of some more spec test scripts
357
-
358
-### cordova-sqlite-storage 0.8.2
359
-
360
-- Workaround fix for empty readTransaction issue (litehelpers/Cordova-sqlite-storage#409)
361
-- Split spec/www/spec/legacy.js into db-open-close-delete-test.js & tx-extended.js
362
-
363
-### cordova-sqlite-storage 0.8.0
364
-
365
-- Simple sql batch transaction function
366
-- Echo test function
367
-- All iOS operations are now using background processing (reported to resolve intermittent problems with cordova-ios@4.0.1)
368
-- Java source of Android version now using io.sqlc package
369
-- Drop Android-sqlite-connector support
370
-- Drop WP(8) and Windows support
371
-
372
-### 0.7.14
373
-
374
-- REGEXP support completely removed from this version branch
375
-- Remove src/android/libs/.gitignore (inadvertently added in 0.7.13)
376
-
377
-### 0.7.13
378
-
379
-- REGEXP support partially removed from this version branch
380
-- Rename Windows C++ Database close function to closedb to resolve conflict for Windows Store certification
381
-- Android version with sqlite `3.8.10.2` embedded (with error messages fixed)
382
-- Pre-populated database support removed from this version branch
383
-- Amazon Fire-OS support removed
384
-- Fix conversion warnings in iOS version
385
-
386
-### 0.7.12
387
-
388
-- Fix to Windows "Universal" version to support big integers
389
-- Implement database close and delete operations for Windows "Universal"
390
-- Fix readTransaction to skip BEGIN/COMMIT/ROLLBACK
391
-
392
-### 0.7.11
393
-
394
-- Fix plugin ID in plugin.xml to match npm package ID
395
-- Unpacked sqlite-native-driver.so libraries from jar
396
-- Fix conversion of INTEGER type (iOS version)
397
-- Disable code to read BLOB as Base-64 (iOS version) due to https://issues.apache.org/jira/browse/CB-9638
398
-
399
-### 0.7.10
400
-
401
-- Use Android-sqlite-connector instead of sqlite4java
402
-
403
-### 0.7.9
404
-
405
-- Build iOS and Windows versions with sqlite 3.8.10.2 embedded
406
-- Fix plugin id to match npm package id
407
-
408
-### 0.7.8
409
-
410
-- Support FTS3/FTS4 and R-Tree in iOS and Windows "Universal" (8.1) versions
411
-- Build ARM target with Function Level Linking ref: http://www.monkey-x.com/Community/posts.php?topic=7739
412
-- SQLite3.Windows.vcxproj and SQLite3.WindowsPhone.vcxproj in their own directories to avoid problems due to temporary files
413
-
414
-### 0.7.7
415
-
416
-- include build of sqlite4java for Android x86_64 and arm-64
417
-- clean publish to plugins.cordova.io
418
-
419
-### 0.7.6
420
-
421
-- Small fix to plugin id
422
-- Disable use of gethostuuid() in sqlite3.c (only used in iOS version)
423
-- published to plugins.cordova.io - [BUG] published extra junk in workarea, causing problems with Windows (Universal) version
424
-
425
-### 0.7.5
426
-
427
-- Windows (Universal) version now supports both Windows 8.1 and Windows Phone 8.1
428
-- iOS and Windows versions are now built with sqlite 3.8.9 embedded
429
-- Improved locking style and other optimizations applied for iOS version
430
-
431
-### 0.7.4
432
-
433
-- iOS and Windows (8.1) versions built to keep non-essential temporary sqlite files in memory
434
-- Option to use legacy Android database library, with Android locking/closing issue (BUG #193) workaround included again
435
-
436
-### 0.7.3
437
-
438
-- insertId & rowsAffected implemented for Windows (8.1)
439
-- plugin id changed
440
-
441
-### 0.7.2
442
-
443
-- Android version with sqlite4java (sqlite 3.8.7 embedded), which solves BUG #193: Android closing/locking issue (ICU-UNICODE integration is now missing)
444
-- iOS version fixed to override the correct pluginInitialize method and built with sqlite 3.8.8.3 embedded
445
-
446
-### 0.7.1
447
-
448
-- Project renamed
449
-- Initial version for Windows (8.1) [with sqlite 3.8.8.3 embedded]
450
-- Abort initially pending transactions for db handle (due to incorrect password key, for example) [from Cordova-sqlcipher-storage]
451
-- WP7 build enabled (NOT TESTED)
452
-
453
-### 1.0.6
454
-
455
-- Proper handling of transactions that may be requested before the database open operation is completed
456
-- Report an error upon attempt to close a database handle object multiple times.
457
-
458
-### 1.0.5
459
-
460
-- Workaround for Android db locking/closing issue
461
-- Fix double-precision REAL values in result (iOS version)
462
-- Fix query result truncation in case of NULL character (\0 or \u0000) (iOS version)
463
-- Convert array SQL parameters to string, according to match Web SQL spec
464
-- Fix closing of Android database
465
-- Some fixes for SQL API error handling to be consistent with Web SQL
466
-
467
-### 1.0.4
468
-
469
-- Pre-populated database option (Android/iOS)
470
-- Option to select database location to disable iCloud backup (iOS ONLY)
471
-- Safeguard against closing of database while transaction is pending
472
-- Fix to prevent double marshaling of data
473
-
474
-### 1.0.3
475
-
476
-- Fixed issue with multi-page apps on Android (due to problem when closing & re-opening app)
477
-
478
-### 1.0.2
479
-
480
-- Workaround for issue with multiple UPDATE statements WP(8) (#128)
481
-
482
-### 1.0.1
483
-
484
-- Support Cordova 3.3.0/3.4.0 to support Amazon-FireOS
485
-- Fixes for WP(8):
486
-  - use one thread per db to solve open/close/delete issues
487
-  - fix integer data binding
488
-- Fix open/close callbacks Android & WP(8)
489
-- Resolve issue with INSERT OR IGNORE (Android)

+ 0
- 33
node_modules/cordova-sqlite-storage/CONTRIBUTING.md Datei anzeigen

@@ -1,33 +0,0 @@
1
-# General
2
-
3
-**IMPORTANT:** Please raise general questions in [litehelpers / Cordova-sqlite-help / issues](https://github.com/litehelpers/Cordova-sqlite-help/issues).
4
-
5
-## Reproducible bugs
6
-
7
-- Verify the results of calling the echoTest and selfTest functions as described in README.md
8
-- Check the pitfalls and other troubleshooting steps in README.md and [brodybits / Avoiding-some-Cordova-pitfalls](https://github.com/brodybits/Avoiding-some-Cordova-pitfalls)
9
-- Reproduce the issue in a fresh, clean project, preferably based on [brodybits / Cordova-sqlite-bootstrap-test](https://github.com/brodybits/Cordova-sqlite-bootstrap-test) or [brodybits / cordova-sqlite-test-app](https://github.com/brodybits/cordova-sqlite-test-app).
10
-
11
-Please see README.md for more details.
12
-
13
-## Feature requests
14
-
15
-Feature requests are welcome for community discussion and future consideration. Preference will be given to paid customers. Please contact <sales@litehelpers.net> for more information.
16
-
17
-## Other questions
18
-
19
-**NOTE:** As stated above please other questions in [litehelpers / Cordova-sqlite-help / issues](https://github.com/litehelpers/Cordova-sqlite-help/issues).
20
-
21
-## Contributing patches
22
-
23
-- Patches with bug fixes are helpful, especially when submitted with test code.
24
-- Other enhancements are welcome for consideration, when submitted with test code and are working for all supported platforms. Increase of complexity should be avoided.
25
-- All contributions may be reused by [@brodybits](https://github.com/brodybits) under another license in the future. Efforts will be taken to give credit for major contributions but it will not be guaranteed.
26
-- Project restructuring, i.e. moving files and/or directories around, should be avoided if possible.
27
-
28
-Please see README.md for more details.
29
-
30
-## Other
31
-
32
-- Testimonials of apps that are using this plugin would be especially helpful.
33
-- Reporting issues can help improve the quality of this plugin.

+ 0
- 143
node_modules/cordova-sqlite-storage/HISTORY.md Datei anzeigen

@@ -1,143 +0,0 @@
1
-# History
2
-
3
-## Overall
4
-
5
-@brodybits (Christopher J. Brody aka Chris Brody) assembled the project in April 2012
6
-from the following parts:
7
-- DroidGap SQLite Storage Java and Javascript parts
8
-- Phonegap-SQLitePlugin for iOS by @davibe (Davide Bertola <dade@dadeb.it>) and
9
-  @joenoon (Joe Noon <joenoon@gmail.com>)
10
-
11
-@brodybits has been maintaining this project with a number of bug fixes and other improvements.
12
-
13
-A number of contributions have been integrated. The most important contributors are explicitly
14
-mentioned in AUTHORS.md.
15
-
16
-## 2009-2010
17
-
18
-DroidGap Storage Java and Javascript parts were initially added in December 2009.
19
-
20
-## 2011
21
-
22
-Phonegap-SQLitePlugin for iOS was started by @davibe in June 2011.
23
-
24
-In September 2011 @joenoon rewrote the Javascript (using CoffeeScript) and added a
25
-Lawnchair adapter.
26
-
27
-## 2012
28
-
29
-The original Phonegap-SQLitePlugin for iOS had a major deviation from the Web SQL API draft.
30
-While the Web SQL API draft keeps the sql and the parameters array as separate parameters,
31
-the original Phonegap-SQLitePlugin combined the sql and parameters in a single array.
32
-This project as assembled by @brodybits keeps the sql and parameters array as separate
33
-parameters to follow the Web SQL API draft more closely.
34
-
35
-@marcucio (Mike Arcucio) contributed a major rework of the Android version to support
36
-efficient batch processing.
37
-
38
-For the first year the Javascript part was completely different for the iOS and
39
-Android versions. @brodybits introduced a QUnit test suite, with some help from
40
-the Lawnchair QUnit test suite as well as the usage sample by @joenoon and @davibe.
41
-
42
-In October 2012 @ef4 (Edward Faulkner) reworked the Javascript for the iOS version
43
-to implement the Web SQL failure-safe transaction semantics, along with some tests.
44
-
45
-In December 2012 @brodybits split the project into separate Android and iOS parts
46
-(merged back together in September 2013).
47
-
48
-In December 2012 @marcucio (Mike Arcucio) made a WP8 version using CSharp-SQLite.
49
-
50
-## 2013
51
-
52
-In May 2013 @j3k0 (Jean-Christophe Hoelt <hoelt@fovea.cc>) contributed major changes
53
-to the iOS version to work in Cordova 2.7 and support background processing.
54
-
55
-In July 2013 @brodybits updated the Android version to use one background thread
56
-per database and ported the failure-safe transaction semantics to work in the
57
-Android version (with the help of CoffeeScript).
58
-
59
-In August 2013 @brodybits fixed the iOS version to work with the Javascript from
60
-the Android version.
61
-
62
-In September 2013 @brodybits merged the Android version and iOS version to use the
63
-same Javascript interface.
64
-
65
-In September 2013 @brodybits published a fork of the WP8 version with a version
66
-of the CSharp-SQLite source embedded.
67
-
68
-Merge notes: The merged version from September 2013 has some of the early commits
69
-repeated in history. This is because @brodybits removed the iOS sources from the
70
-old Android version using the git filter-branch command.
71
-
72
-## 2014
73
-
74
-In July 2014 @Gillardo (Darren Gillard <darren.gillard81@gmail.com>) contributed an integration
75
-of the WP8 version with background processing and improved transaction support.
76
-
77
-Also in July 2014 @nolanlawson contributed a number of fixes and got this project
78
-working with PouchDB. For example: introduction of nextTick to schedule actions to be taken
79
-once the current HTML(5) event handler is finished.
80
-
81
-In August 2014 Mark Oppenheim (<mark.oppenheim@mnetics.co.uk>) contributed the following:
82
-- working open/close callbacks and repeated open/close/delete fixes for Android and WP8 versions
83
-  (@brodybits fixed these for the iOS version);
84
-- fixed WP8 version to use one thread per database.
85
-
86
-NOTE: The WP8 version is currently supported in the Cordova-sqlite-legacy version.
87
-
88
-## 2015
89
-
90
-In January 2015 @aarononeal (Aaron Oneal <aaron.oneal@spicypixel.com>) raised PR #170 with a
91
-number of fixes, including:
92
-- Fix to prevent double marshaling of data.
93
-- Fix test runner to use correct plugin id (subsequently broken by @brodybits).
94
-- Fix database close conditions and unit test (reject attempt to close database
95
-  the middle of a transaction).
96
-- Propagate statement failures to transaction failures (in the case when a
97
-  statement error handler does not return false).
98
-- Fix transaction and statement errors to conform to SQLError.
99
-- Fix warning regarding test runner viewport format.
100
-- Fix executeSql to throw on finalized transactions.
101
-- Reproduce & fix truncation in iOS query result string encoding
102
-  (in case of UNICODE \u0000 character in the middle).
103
-
104
-In addition, PR #170 includes a two-way SQL blob marshalling mechanism that is still under
105
-consideration.
106
-
107
-Other major changes by @brodybits in 2015:
108
-- Porting of the existing test suite to work within the Jasmine framework.
109
-- Introduction of workaround for Android locking bug.
110
-- Introduction of Windows target version (Windows 8.0/Windows 8.1/Windows Phone 8.1),
111
-  which is now available in cordova-sqlite-ext and Cordova-sqlite-legacy version projects.
112
-- Introduction of lightweight Android-sqlite-connector database library, which is
113
-  now available in cordova-sqlite-ext and Cordova-sqlite-legacy version projects.
114
-- Use of Circle CI (Android version) and Travis CI (iOS version).
115
-- Introduction of other version projects:
116
-  - Cordova-sqlcipher-adapter
117
-  - cordova-sqlite-ext with REGEXP and pre-populated database support
118
-  - Enterprise version with memory fix and other enhancements,
119
-    available under GPL or commercial licensing options
120
-- react-native-sqlite-storage version for Android and iOS developed and maintained
121
-  by @andpor (Andrzej Porebski <fkuciapa@yahoo.com>), based on this project
122
-
123
-## Major changes 2016
124
-
125
-New features:
126
-- Echo self-test function
127
-- Simple sql batch query interface
128
-
129
-Installation changes
130
-- Use of `before_plugin_install` hook to install external dependencies
131
-
132
-New versions introduced
133
-- Cordova-sqlite-evcore-extbuild-free with major performance and memory fixes for Android,
134
-  available under GPL or commercial licensing options with support for PhoneGap Build
135
-- Cordova-sqlite-evplus (legacy) versions with GPL or premium commercial licensing options
136
-
137
-## Major changes 2017
138
-
139
-Windows platform toolset dependency updated for Visual Studio 2017
140
-
141
-## Recent changes
142
-
143
-See CHANGES.md

+ 0
- 49
node_modules/cordova-sqlite-storage/LICENSE.md Datei anzeigen

@@ -1,49 +0,0 @@
1
-# Licenses
2
-
3
-## Common Javascript
4
-
5
-MIT or Apache 2.0
6
-
7
-## for browser platform
8
-
9
-MIT or Apache 2.0
10
-
11
-### sql.js
12
-
13
-MIT
14
-
15
-## for Android
16
-
17
-MIT or Apache 2.0
18
-
19
-### Android-sqlite-connector
20
-
21
-Unlicense (public domain)
22
-
23
-### Android-sqlite-ext-native-driver
24
-
25
-Unlicense (public domain)
26
-
27
-## for iOS & macOS
28
-
29
-MIT only
30
-
31
-based on Phonegap-SQLitePlugin by @davibe (Davide Bertola <dade@dadeb.it>) and @joenoon (Joe Noon <joenoon@gmail.com>)
32
-
33
-includes and uses PSPDFThreadSafeMutableDictionary (PSPDFThreadSafeMutableDictionary.m <https://gist.github.com/steipete/5928916>) MIT license by @steipete (<https://gist.github.com/steipete>)
34
-
35
-## for Windows
36
-
37
-MIT or Apache 2.0
38
-
39
-### SQLite3-WinRT
40
-
41
-by @doo (doo GmbH)
42
-
43
-MIT License
44
-
45
-## Common native code
46
-
47
-### SQLite3
48
-
49
-Public domain

+ 0
- 1842
node_modules/cordova-sqlite-storage/README.md
Datei-Diff unterdrückt, da er zu groß ist
Datei anzeigen


+ 0
- 1034
node_modules/cordova-sqlite-storage/SQLitePlugin.coffee.md
Datei-Diff unterdrückt, da er zu groß ist
Datei anzeigen


+ 0
- 0
node_modules/cordova-sqlite-storage/bin/test.ps1 Datei anzeigen


Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.