Exemplo n.º 1
0
        /// <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);
        }
Exemplo n.º 2
0
        /// <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);
        }
Exemplo n.º 3
0
 public PhysicalFileInfo(PhysicalFilesWatcher filesWatcher, FileInfo info)
 {
     _info = info;
     _filesWatcher = filesWatcher;
 }
Exemplo n.º 4
0
 public PhysicalFileInfo(PhysicalFilesWatcher filesWatcher, FileInfo info)
 {
     _info         = info;
     _filesWatcher = filesWatcher;
 }