2020-04-03 01:08:52 +11:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.IO;
|
|
|
|
|
|
|
2021-02-18 11:06:02 +01:00
|
|
|
|
namespace Umbraco.Cms.Core.Composing
|
2020-04-03 01:08:52 +11:00
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Paths used to determine the <see cref="IRuntimeHash"/>
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public sealed class RuntimeHashPaths
|
|
|
|
|
|
{
|
|
|
|
|
|
private readonly List<DirectoryInfo> _paths = new List<DirectoryInfo>();
|
|
|
|
|
|
private readonly Dictionary<FileInfo, bool> _files = new Dictionary<FileInfo, bool>();
|
|
|
|
|
|
|
2020-11-20 11:11:52 +00:00
|
|
|
|
public RuntimeHashPaths AddFolder(DirectoryInfo pathInfo)
|
|
|
|
|
|
{
|
|
|
|
|
|
_paths.Add(pathInfo);
|
|
|
|
|
|
return this;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-04-03 01:08:52 +11:00
|
|
|
|
public void AddFile(FileInfo fileInfo, bool scanFileContent = false) => _files.Add(fileInfo, scanFileContent);
|
|
|
|
|
|
|
|
|
|
|
|
public IEnumerable<DirectoryInfo> GetFolders() => _paths;
|
|
|
|
|
|
public IReadOnlyDictionary<FileInfo, bool> GetFiles() => _files;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|