Skip to content

Commit

Permalink
feat(filepath): add cordova-plugin-filepath (#714)
Browse files Browse the repository at this point in the history
  • Loading branch information
ColinFrick authored and ihadeed committed Oct 18, 2016
1 parent 9677656 commit 0660a3b
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import { Facebook } from './plugins/facebook';
import { File } from './plugins/file';
import { FileChooser } from './plugins/file-chooser';
import { FileOpener } from './plugins/file-opener';
import { FilePath } from './plugins/filepath';
import { Transfer } from './plugins/filetransfer';
import { Flashlight } from './plugins/flashlight';
import { Geofence } from './plugins/geofence';
Expand Down Expand Up @@ -153,6 +154,7 @@ export * from './plugins/file';
export * from './plugins/file-chooser';
export * from './plugins/file-opener';
export * from './plugins/filetransfer';
export * from './plugins/filepath';
export * from './plugins/flashlight';
export * from './plugins/geofence';
export * from './plugins/geolocation';
Expand Down Expand Up @@ -262,6 +264,7 @@ window['IonicNative'] = {
File,
FileChooser,
FileOpener,
FilePath,
Flashlight,
Geofence,
Geolocation,
Expand Down
34 changes: 34 additions & 0 deletions src/plugins/filepath.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { Plugin, Cordova } from './plugin';

declare var window: any;

/**
* @name FilePath
* @description
*
* This plugin allows you to resolve the native filesystem path for Android content URIs and is based on code in the aFileChooser library.
*
* @usage
* ```
* import {FilePath} from 'ionic-native';
*
* FilePath.resolveNativePath(path)
* .then(filePath => console.log(filePath);
* .catch(err => console.log(err);
*
* ```
*/
@Plugin({
plugin: 'cordova-plugin-filepath',
pluginRef: 'window.FilePath',
repo: 'https://github.com/hiddentao/cordova-plugin-filepath',
platforms: ['Android']
})
export class FilePath {
/**
* Resolve native path for given content URL/path.
* @param {String} path Content URL/path.
*/
@Cordova()
static resolveNativePath(path: string): Promise<string> {return; }
}

0 comments on commit 0660a3b

Please sign in to comment.