Esempio n. 1
0
        public IAppFileSystemLoader Init(int appId, string path, ILog log)
        {
            Log.LinkTo(log);
            ZoneMapper.Init(log);

            var wrapLog = Log.Call($"{appId}, {path}, ...");

            AppId = appId;
            try
            {
                Log.Add($"Trying to build path based on tenant. If it's in search mode, the {nameof(ITenant)} will be missing. Id: {Tenant.Id}");
                EnsureTenantIsLoadedWhenDiFails();
                var fullPath = Tenant.AppsRoot + "/" + path + "/" + Eav.Constants.FolderAppExtensions;
                Path = HostingEnvironment.MapPath(fullPath);
                Log.Add("System path:" + Path);
            }
            catch (Exception e)
            {
                // ignore
                wrapLog("error: " + e.Message);
                return(this);
            }

            wrapLog(null);
            return(this);
        }
Esempio n. 2
0
        public IAppFileSystemLoader Init(int appId, string path, ILog log)
        {
            Log.LinkTo(log);
            ZoneMapper.Init(log);

            var wrapLog = Log.Call($"{appId}, {path}, ...");

            AppId = appId;
            try
            {
                Log.Add($"Trying to build path based on tenant. If it's in search mode, the {nameof(ISite)} will be missing. Id: {Site.Id}");
                EnsureSiteIsLoadedWhenDiFails();
                var fullPath = System.IO.Path.Combine(Site.AppsRootPhysicalFull, path, Eav.Constants.FolderAppExtensions);
                Path = fullPath;
                Log.Add("System path:" + Path);
            }
            catch (Exception e)
            {
                // ignore
                wrapLog("error: " + e.Message);
                return(this);
            }

            wrapLog(null);
            return(this);
        }