List of usage examples for org.apache.cordova.file FileUtils registerFilesystem
public void registerFilesystem(Filesystem fs)
From source file:org.chromium.SyncFileSystem.java
License:Open Source License
@Override public void initialize(CordovaInterface cordova, CordovaWebView webView) { super.initialize(cordova, webView); String syncableRoot = cordova.getActivity().getFilesDir().getAbsolutePath() + "/syncfs/"; new File(syncableRoot).mkdirs(); PluginManager pm = null;/*from w ww . jav a2 s.com*/ try { Method gpm = webView.getClass().getMethod("getPluginManager"); pm = (PluginManager) gpm.invoke(webView); } catch (Exception e) { } if (pm == null) { try { Field pmf = webView.getClass().getField("pluginManager"); pm = (PluginManager) pmf.get(webView); } catch (Exception e) { } } FileUtils filePlugin = (FileUtils) pm.getPlugin("File"); LocalFilesystem syncFs = new LocalFilesystem("syncable", cordova, syncableRoot); filePlugin.registerFilesystem(syncFs); }