/// <summary> /// Creates a new instance of a PhysicalFileProvider at the given root directory. /// </summary> /// <param name="root">The root directory. This should be an absolute path.</param> public PhysicalFileProvider(string root) { if (!Path.IsPathRooted(root)) { throw new ArgumentException("The path must be absolute.", nameof(root)); } var fullRoot = Path.GetFullPath(root); // When we do matches in GetFullPath, we want to only match full directory names. Root = EnsureTrailingSlash(fullRoot); if (!Directory.Exists(Root)) { throw new DirectoryNotFoundException(Root); } // Monitor only the application's root folder. _filesWatcher = new PhysicalFilesWatcher(Root); }
public PhysicalFileInfo(PhysicalFilesWatcher filesWatcher, FileInfo info) { _info = info; _filesWatcher = filesWatcher; }