public FileSystemBinaryManager(IDasBlogSettings settings)
        {
            var siteConfig = settings.SiteConfiguration;

            virtBinaryPathRelativeToContentRoot = siteConfig.BinariesDir.TrimStart('~');             // => "/content/binary"
            var physBinaryPath = Path.Combine(settings.WebRootDirectory, virtBinaryPathRelativeToContentRoot.TrimStart('/'));

            Uri physBinaryPathUrl  = new Uri(physBinaryPath);
            var loggingDataService = LoggingDataServiceFactory.GetService(settings.WebRootDirectory + settings.SiteConfiguration.LogDir);

            dataService = BinaryDataServiceFactory.GetService(physBinaryPath, physBinaryPathUrl, loggingDataService);
        }
Exemplo n.º 2
0
        public FileSystemBinaryManager(IDasBlogSettings settings)
        {
            var siteConfig = settings.SiteConfiguration;

            virtBinaryPathRelativeToContentRoot = siteConfig.BinariesDir.TrimStart('~');                                         // => "/content/binary"
            string physBinaryPath = Path.Combine(settings.WebRootDirectory, virtBinaryPathRelativeToContentRoot.TrimStart('/')); // => "c:\...\DaBlog.Web.UI\content/binary"
            // WebRootDirectory is a misnomer.  It should be called ContentRootDirectory
            // ContentRootDirectory is not "c:\...\DasBlog.Web.UI\contnet".  It is actually "c:\...\DasBlog.Web.UI"
            // WebRootDirectory is "wwwroot".
            Uri physBinaryPathUrl  = new Uri(physBinaryPath);
            var loggingDataService = LoggingDataServiceFactory.GetService(settings.WebRootDirectory + settings.SiteConfiguration.LogDir);

            dataService = BinaryDataServiceFactory.GetService(physBinaryPath, physBinaryPathUrl, loggingDataService);
        }
Exemplo n.º 3
0
        public FileSystemBinaryManager(IDasBlogSettings dasBlogSettings, IConfigFileService <MetaTags> metaTagFileService,
                                       IConfigFileService <SiteConfig> siteConfigFileService, IOptions <ConfigFilePathsDataOption> optionsAccessor)
        {
            this.dasBlogSettings       = dasBlogSettings;
            this.metaTagFileService    = metaTagFileService;
            this.siteConfigFileService = siteConfigFileService;
            options          = optionsAccessor.Value;
            contentBinaryUrl = dasBlogSettings.RelativeToRoot(options.BinaryUrlRelative);

            var physBinaryPathUrl = new Uri(contentBinaryUrl);

            var loggingDataService = LoggingDataServiceFactory.GetService(Path.Combine(dasBlogSettings.WebRootDirectory, dasBlogSettings.SiteConfiguration.LogDir));

            this.binaryDataService = BinaryDataServiceFactory.GetService(options.BinaryFolder, physBinaryPathUrl, loggingDataService);
        }
Exemplo n.º 4
0
        public FileSystemBinaryManager(IDasBlogSettings dasBlogSettings, IConfigFileService <MetaTags> metaTagFileService, IConfigFileService <SiteConfig> siteConfigFileService)
        {
            this.dasBlogSettings       = dasBlogSettings;
            this.metaTagFileService    = metaTagFileService;
            this.siteConfigFileService = siteConfigFileService;

            var siteConfig = this.dasBlogSettings.SiteConfiguration;

            virtBinaryPathRelativeToContentRoot = siteConfig.BinariesDir.TrimStart('~');
            var physBinaryPath = Path.Combine(this.dasBlogSettings.WebRootDirectory, virtBinaryPathRelativeToContentRoot.TrimStart('/'));

            var physBinaryPathUrl  = new Uri(physBinaryPath);
            var loggingDataService = LoggingDataServiceFactory.GetService(dasBlogSettings.WebRootDirectory + dasBlogSettings.SiteConfiguration.LogDir);

            dataService = BinaryDataServiceFactory.GetService(physBinaryPath, physBinaryPathUrl, loggingDataService);
        }