Skip to content

Commit cd395d2

Browse files
authored
feat(Filesystem): remove FilesystemDirectory.Application (#2514)
1 parent 7cb77c8 commit cd395d2

File tree

5 files changed

+1
-23
lines changed

5 files changed

+1
-23
lines changed

android/capacitor/src/main/java/com/getcapacitor/plugin/Filesystem.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ private Charset getEncoding(String encoding) {
6565
private File getDirectory(String directory) {
6666
Context c = bridge.getContext();
6767
switch(directory) {
68-
case "APPLICATION":
69-
return c.getFilesDir();
7068
case "DOCUMENTS":
7169
return Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS);
7270
case "DATA":

core/src/core-plugin-definitions.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -566,10 +566,6 @@ export interface FilesystemPlugin extends Plugin {
566566
}
567567

568568
export enum FilesystemDirectory {
569-
/**
570-
* The Application directory
571-
*/
572-
Application = 'APPLICATION',
573569
/**
574570
* The Documents directory
575571
*/

example/src/pages/filesystem/filesystem.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export class FilesystemPage {
109109
try {
110110
let ret = await Plugins.Filesystem.getUri({
111111
path: 'text.txt',
112-
directory: FilesystemDirectory.Application
112+
directory: FilesystemDirectory.Data
113113
});
114114
alert(ret.uri);
115115
} catch(e) {

ios/Capacitor/Capacitor/Plugins/Filesystem.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ public class CAPFilesystemPlugin : CAPPlugin {
1212
switch directory {
1313
case "DOCUMENTS":
1414
return .documentDirectory
15-
case "APPLICATION":
16-
return .applicationDirectory
1715
case "CACHE":
1816
return .cachesDirectory
1917
default:

site/docs-md/apis/filesystem/index.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -137,20 +137,6 @@ async rename() {
137137
}
138138
}
139139

140-
async copy() {
141-
try {
142-
// This example copies a file from the app directory to the documents directory
143-
let ret = await Filesystem.copy({
144-
from: 'assets/icon.png',
145-
to: 'icon.png',
146-
directory: FilesystemDirectory.Application,
147-
toDirectory: FilesystemDirectory.Documents
148-
});
149-
} catch(e) {
150-
console.error('Unable to copy file', e);
151-
}
152-
}
153-
154140
async copy() {
155141
try {
156142
// This example copies a file within the documents directory

0 commit comments

Comments
 (0)