Skip to content

Commit

Permalink
feat(Filesystem): remove FilesystemDirectory.Application (#2514)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcesarmobile authored Mar 3, 2020
1 parent 7cb77c8 commit cd395d2
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ private Charset getEncoding(String encoding) {
private File getDirectory(String directory) {
Context c = bridge.getContext();
switch(directory) {
case "APPLICATION":
return c.getFilesDir();
case "DOCUMENTS":
return Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS);
case "DATA":
Expand Down
4 changes: 0 additions & 4 deletions core/src/core-plugin-definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -566,10 +566,6 @@ export interface FilesystemPlugin extends Plugin {
}

export enum FilesystemDirectory {
/**
* The Application directory
*/
Application = 'APPLICATION',
/**
* The Documents directory
*/
Expand Down
2 changes: 1 addition & 1 deletion example/src/pages/filesystem/filesystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export class FilesystemPage {
try {
let ret = await Plugins.Filesystem.getUri({
path: 'text.txt',
directory: FilesystemDirectory.Application
directory: FilesystemDirectory.Data
});
alert(ret.uri);
} catch(e) {
Expand Down
2 changes: 0 additions & 2 deletions ios/Capacitor/Capacitor/Plugins/Filesystem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ public class CAPFilesystemPlugin : CAPPlugin {
switch directory {
case "DOCUMENTS":
return .documentDirectory
case "APPLICATION":
return .applicationDirectory
case "CACHE":
return .cachesDirectory
default:
Expand Down
14 changes: 0 additions & 14 deletions site/docs-md/apis/filesystem/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,20 +137,6 @@ async rename() {
}
}

async copy() {
try {
// This example copies a file from the app directory to the documents directory
let ret = await Filesystem.copy({
from: 'assets/icon.png',
to: 'icon.png',
directory: FilesystemDirectory.Application,
toDirectory: FilesystemDirectory.Documents
});
} catch(e) {
console.error('Unable to copy file', e);
}
}

async copy() {
try {
// This example copies a file within the documents directory
Expand Down

0 comments on commit cd395d2

Please sign in to comment.