text: var m=m||{};m.aio=m.aio||{};m.aio.filemanager=m.aio.filemanager||{};
  m.aio.filemanager.Preference={USER_PREFERENCE:".pref",_pref:{},_logger:null,init:function(a){try{this._logger=require("x.logger.js").getLogger("m.aio.filemanager.Preference")}catch(e){this._logger={log:function(){}}}var b=require("fs"),c=this._getUserPref();c?b.exists(c,function(e){e?b.stat(c,function(f,h){f?a&&a(f):h.isFile()?b.readFile(c,function(d,g){if(d)a&&a(d);else{if(0<g.length){d=g.toString("utf8");try{this._pref=JSON.parse(d)}catch(k){this._pref={}}}a&&a()}}.bind(this)):b.unlink(c,function(d){d?
  a&&a(d):b.open(c,"w",function(g){a&&a(g)})})}.bind(this)):b.open(c,"w",function(f){a(f)})}.bind(this)):a&&a(Error("pref file path is null"))},save:function(a,b){this._pref[a]=b;this._saveUserPref()},read:function(a){return this._pref[a]},_getUserPref:function(){var a=require("path"),b=m.aio.filemanager.FileManager.getAppRootDataPath();return b?b+a.sep+this.USER_PREFERENCE:null},_saveUserPref:function(){var a=this._getUserPref(),b=require("fs");if(a){this._logger.log("trace","save user pref:"+a);var c=
  this;b.writeFile(a,JSON.stringify(this._pref),function(e){e&&c._logger.log("trace","save user pref error:"+e.stack)})}}};
  m.aio.filemanager.FileManager={_nativeFm:null,init:function(a,b){a?this._nativeFm?b&&b():(this._nativeFm=a,m.aio.filemanager.Preference.init(function(){b&&b()})):b&&b(Error("nativeFileManager is null"))},getAppRootDataPath:function(){return this._nativeFm?this._nativeFm.getAppRootDataPath():null},getAppResourcePath:function(){var a=require("path"),b=this.getAppRootDataPath();return b?b+a.sep+"resources":null},getUserRootDataPath:function(){return this._nativeFm?this._nativeFm.getUserRootDataPath():
  null},getUserResourcePath:function(){var a=require("path"),b=this.getUserRootDataPath();return b?b+a.sep+"resources":null},getUserLogPath:function(){var a=require("path"),b=this.getUserRootDataPath();return b?b+a.sep+"logs":null},getTmpDir:function(){return this._nativeFm.getTmpDir()},getPref:function(){return m.aio.filemanager.Preference}};"undefined"!=typeof module&&null!=module&&(module.exports=m.aio.filemanager.FileManager,module.exports.Preference=m.aio.filemanager.Preference);
  