using LJProxy.Services; using Microsoft.Extensions.FileProviders; using Microsoft.Extensions.Primitives; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace LJProxy.Providers { public class L1SvrFileProvider : IFileProvider { private string _contentRoot; private LJClientPoolService _ljClient; public L1SvrFileProvider(string contentRoot, LJClientPoolService ljClient) { _contentRoot = contentRoot; _ljClient = ljClient; } public IDirectoryContents GetDirectoryContents(string subpath) { throw new NotImplementedException(); } public IFileInfo GetFileInfo(string subpath) { string physicSubpath = subpath.Replace("/","\\"); string directory = @$"{_contentRoot}\wwwroot"; var fullFilepath = @$"{directory}{physicSubpath}"; var result = new L1SvrFileInfo(fullFilepath, physicSubpath,_ljClient.Pool); return result; } public IChangeToken Watch(string filter) { throw new NotImplementedException(); } } }