Skip to content

Commit fba0e67

Browse files
committed
fix!: remove deprecated platforms
1 parent 6bff845 commit fba0e67

18 files changed

+19
-3324
lines changed

README.md

+11-60
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ Although the object is in the global scope, it is not available to applications
5757

5858
- Android
5959
- iOS
60-
- OS X
61-
- Windows*
6260
- Browser
6361

6462
\* _These platforms do not support `FileReader.readAsArrayBuffer` nor `FileWriter.write(blob)`._
@@ -70,22 +68,22 @@ Each URL is in the form _file:///path/to/spot/_, and can be converted to a
7068
`DirectoryEntry` using `window.resolveLocalFileSystemURL()`.
7169

7270
* `cordova.file.applicationDirectory` - Read-only directory where the application
73-
is installed. (_iOS_, _Android_, _BlackBerry 10_, _OSX_, _windows_)
71+
is installed. (_iOS_, _Android_)
7472

7573
* `cordova.file.applicationStorageDirectory` - Root directory of the application's
76-
sandbox; on iOS & windows this location is read-only (but specific subdirectories [like
77-
`/Documents` on iOS or `/localState` on windows] are read-write). All data contained within
78-
is private to the app. (_iOS_, _Android_, _BlackBerry 10_, _OSX_)
74+
sandbox; on iOS this location is read-only (but specific subdirectories [like
75+
`/Documents` on iOS] is read-write). All data contained within
76+
is private to the app. (_iOS_, _Android_)
7977

8078
* `cordova.file.dataDirectory` - Persistent and private data storage within the
8179
application's sandbox using internal memory (on Android, if you need to use
8280
external memory, use `.externalDataDirectory`). On iOS, this directory is not
83-
synced with iCloud (use `.syncedDataDirectory`). (_iOS_, _Android_, _BlackBerry 10_, _windows_)
81+
synced with iCloud (use `.syncedDataDirectory`). (_iOS_, _Android_)
8482

8583
* `cordova.file.cacheDirectory` - Directory for cached data files or any files
8684
that your app can re-create easily. The OS may delete these files when the device
8785
runs low on storage, nevertheless, apps should not rely on the OS to delete files
88-
in here. (_iOS_, _Android_, _BlackBerry 10_, _OSX_, _windows_)
86+
in here. (_iOS_, _Android_)
8987

9088
* `cordova.file.externalApplicationStorageDirectory` - Application space on
9189
external storage. (_Android_). See [Quirks](#androids-external-storage-quirks).
@@ -96,19 +94,17 @@ Each URL is in the form _file:///path/to/spot/_, and can be converted to a
9694
* `cordova.file.externalCacheDirectory` - Application cache on external storage.
9795
(_Android_). See [Quirks](#androids-external-storage-quirks).
9896

99-
* `cordova.file.externalRootDirectory` - External storage (SD card) root. (_Android_, _BlackBerry 10_). See [Quirks](#androids-external-storage-quirks).
97+
* `cordova.file.externalRootDirectory` - External storage (SD card) root. (_Android_). See [Quirks](#androids-external-storage-quirks).
10098

10199
* `cordova.file.tempDirectory` - Temp directory that the OS can clear at will. Do not
102100
rely on the OS to clear this directory; your app should always remove files as
103-
applicable. (_iOS_, _OSX_, _windows_)
101+
applicable. (_iOS_)
104102

105103
* `cordova.file.syncedDataDirectory` - Holds app-specific files that should be synced
106-
(e.g. to iCloud). (_iOS_, _windows_)
104+
(e.g. to iCloud). (_iOS_)
107105

108106
* `cordova.file.documentsDirectory` - Files private to the app, but that are meaningful
109-
to other application (e.g. Office files). Note that for _OSX_ this is the user's `~/Documents` directory. (_iOS_, _OSX_)
110-
111-
* `cordova.file.sharedDirectory` - Files globally available to all applications (_BlackBerry 10_)
107+
to other application (e.g. Office files). (_iOS_)
112108

113109
## File System Layouts
114110

@@ -191,41 +187,6 @@ These limitations only applies to external filesystems (e.g. `cordova.file.exter
191187

192188
If interfacing with the external file system is a requirement for your application, consider using a [MediaStore](https://www.npmjs.com/search?q=ecosystem%3Acordova%20storage%20access%20framework) plugin instead.
193189

194-
### OS X File System Layout
195-
196-
| Device Path | `cordova.file.*` | `iosExtraFileSystems` | r/w? | OS clears | private |
197-
|:-------------------------------------------------|:----------------------------|:----------------------|:----:|:---------:|:-------:|
198-
| `/Applications/<appname>.app/` | - | bundle | r | N/A | Yes |
199-
| &nbsp;&nbsp;&nbsp;&nbsp;`Content/Resources/` | applicationDirectory | - | r | N/A | Yes |
200-
| `~/Library/Application Support/<bundle-id>/` | applicationStorageDirectory | - | r/w | No | Yes |
201-
| &nbsp;&nbsp;&nbsp;&nbsp;`files/` | dataDirectory | - | r/w | No | Yes |
202-
| `~/Documents/` | documentsDirectory | documents | r/w | No | No |
203-
| `~/Library/Caches/<bundle-id>/` | cacheDirectory | cache | r/w | No | Yes |
204-
| `/tmp/` | tempDirectory | - | r/w | Yes\* | Yes |
205-
| `/` | rootDirectory | root | r/w | No\*\* | No |
206-
207-
**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`.
208-
209-
\* Files persist across app restarts and upgrades, but this directory can
210-
be cleared whenever the OS desires. Your app should be able to recreate any
211-
content that might be deleted. You should clear this directory as
212-
appropriate for your application.
213-
214-
\*\* Allows access to the entire file system. This is only available for non sandboxed apps.
215-
216-
### Windows File System Layout
217-
218-
| Device Path | `cordova.file.*` | r/w? | persistent? | OS clears | private |
219-
|:------------------------------------------------------|:----------------------------|:----:|:-----------:|:---------:|:-------:|
220-
| `ms-appdata:///` | applicationDirectory | r | N/A | N/A | Yes |
221-
| &nbsp;&nbsp;&nbsp;`local/` | dataDirectory | r/w | Yes | No | Yes |
222-
| &nbsp;&nbsp;&nbsp;`temp/` | cacheDirectory | r/w | No | Yes\* | Yes |
223-
| &nbsp;&nbsp;&nbsp;`temp/` | tempDirectory | r/w | No | Yes\* | Yes |
224-
| &nbsp;&nbsp;&nbsp;`roaming/` | syncedDataDirectory | r/w | Yes | No | Yes |
225-
226-
\* The OS may periodically clear this directory
227-
228-
229190
## Android Quirks
230191

231192
### Android Persistent storage location
@@ -510,10 +471,6 @@ var my_media = new Media('cdvfile://localhost/temporary/path/to/file.mp3', ...);
510471
my_media.play();
511472
```
512473
513-
#### cdvfile quirks
514-
- Using `cdvfile://` paths in the DOM is not supported on Windows platform (a path can be converted to native instead).
515-
516-
517474
## List of Error Codes and Meanings
518475
When an error is thrown, one of the following codes will be used.
519476
@@ -582,7 +539,7 @@ When you get file system access using `requestFileSystem`, access is granted for
582539
583540
Here is a request for persistent storage.
584541
585-
>*Note* When targeting WebView clients (instead of a browser) or native apps (Windows), you dont need to use `requestQuota` before using persistent storage.
542+
>*Note* When targeting WebView clients (instead of a browser), you dont need to use `requestQuota` before using persistent storage.
586543
587544
```js
588545
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function (fs) {
@@ -848,12 +805,6 @@ function displayImageByFileURL(fileEntry) {
848805
}
849806
```
850807
851-
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.
852-
853-
```html
854-
<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 *">
855-
```
856-
857808
## Create Directories <a name="createDir"></a>
858809
859810
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.

package.json

+2-6
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
"platforms": [
99
"android",
1010
"browser",
11-
"ios",
12-
"osx",
13-
"windows"
11+
"ios"
1412
]
1513
},
1614
"repository": "github:apache/cordova-plugin-file",
@@ -21,9 +19,7 @@
2119
"ecosystem:cordova",
2220
"cordova-android",
2321
"cordova-browser",
24-
"cordova-ios",
25-
"cordova-osx",
26-
"cordova-windows"
22+
"cordova-ios"
2723
],
2824
"scripts": {
2925
"test": "npm run lint",

plugin.xml

-40
Original file line numberDiff line numberDiff line change
@@ -201,46 +201,6 @@ to config.xml in order for the application to find previously stored files.
201201
<resource-file src="src/ios/CDVFile.bundle" target="CDVFile.bundle" />
202202
</platform>
203203

204-
<!-- osx -->
205-
<platform name="osx">
206-
<config-file target="config.xml" parent="/*">
207-
<feature name="File">
208-
<param name="ios-package" value="CDVFile" />
209-
<param name="onload" value="true" />
210-
</feature>
211-
</config-file>
212-
<header-file src="src/osx/CDVFile.h" />
213-
<source-file src="src/osx/CDVFile.m" />
214-
<header-file src="src/osx/CDVLocalFilesystem.h" />
215-
<source-file src="src/osx/CDVLocalFilesystem.m" />
216-
217-
<!-- osx specific file apis -->
218-
<js-module src="www/osx/FileSystem.js" name="osxFileSystem">
219-
<merges target="FileSystem" />
220-
</js-module>
221-
222-
<js-module src="www/fileSystems-roots.js" name="fileSystems-roots">
223-
<runs/>
224-
</js-module>
225-
226-
<js-module src="www/fileSystemPaths.js" name="fileSystemPaths">
227-
<merges target="cordova" />
228-
<runs/>
229-
</js-module>
230-
</platform>
231-
232-
<!-- windows -->
233-
<platform name="windows">
234-
<js-module src="src/windows/FileProxy.js" name="FileProxy">
235-
<runs />
236-
</js-module>
237-
238-
<js-module src="www/fileSystemPaths.js" name="fileSystemPaths">
239-
<merges target="cordova" />
240-
<runs/>
241-
</js-module>
242-
</platform>
243-
244204
<platform name="browser">
245205
<!-- File for Chrome -->
246206
<js-module src="www/browser/Preparing.js" name="Preparing">

src/browser/FileProxy.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
}, errorCallback);
108108
};
109109

110-
// Overridden by Android, BlackBerry 10 and iOS to populate fsMap
110+
// Overridden by Android and iOS to populate fsMap
111111
require('./fileSystems').getFs = function (name, callback) {
112112
callback(new FileSystem(name, fs_.root));
113113
};

0 commit comments

Comments
 (0)