示例#1
0
        public PersonalCloudRootFileSystem(PersonalCloud personalCloud, Microsoft.Extensions.Logging.ILogger l)
        {
            Logger = l;
//              RootFs = personalCloud.RootFS;
//              return;
            //_PersonalCloud = personalCloud;
            var dic = new Dictionary <string, IFileSystem>();

            dic["Files"] = personalCloud.RootFS;
            var aif = new AppInFs(l);

            aif.GetApps = () => personalCloud.Apps;
            aif.GetUrl  = (x) => {
                try
                {
                    var uri = personalCloud.GetWebAppUri(x);
                    if (uri == null)
                    {
                        Logger.LogError($"personalCloud.GetWebAppUri return null.");
                        return(null);
                    }
                    return(uri.AbsoluteUri);
                }
                catch (Exception e)
                {
                    Logger.LogError(e, $"Exception when calling GetWebAppUri");
                    throw;
                }
            };
            dic["Apps"] = aif;
            RootFs      = new FileSystemContainer(dic, Logger);
        }
示例#2
0
        public PersonalCloudRootFileSystem(PersonalCloud personalCloud, Microsoft.Extensions.Logging.ILogger l)
        {
            Logger = l;
//              RootFs = personalCloud.RootFS;
//              return;
            //_PersonalCloud = personalCloud;
            var dic = new Dictionary <string, IFileSystem>();

            dic["Files"] = personalCloud.RootFS;
            var aif = new AppInFs();

            aif.GetApps = () => personalCloud.Apps;
            aif.GetUrl  = (x) => personalCloud.GetWebAppUri(x).ToString();
            dic["Apps"] = aif;
            RootFs      = new FileSystemContainer(dic, Logger);
        }