RelativePropertyCollectionFile
aMetadataCollectionDirectory Work with video FilePath.IsIgnore Removed IId IsIgnore Keywords RootAmazon SaveAmazon PhysicalFileProvider Message Bump HarFilesDirectory
This commit is contained in:
@ -8,6 +8,7 @@ public class AppSettings
|
||||
{
|
||||
|
||||
public string? Company { get; set; }
|
||||
public string? HarFilesDirectory { get; set; }
|
||||
public int? MaxDegreeOfParallelism { get; set; }
|
||||
public bool? RequireRootDirectoryExists { get; set; }
|
||||
|
||||
@ -21,17 +22,16 @@ public class AppSettings
|
||||
{
|
||||
if (appSettings?.Company is null)
|
||||
{
|
||||
List<string> paths = [];
|
||||
foreach (IConfigurationProvider configurationProvider in configurationRoot.Providers)
|
||||
{
|
||||
if (configurationProvider is not Microsoft.Extensions.Configuration.Json.JsonConfigurationProvider jsonConfigurationProvider)
|
||||
continue;
|
||||
if (jsonConfigurationProvider.Source.FileProvider is not Microsoft.Extensions.FileProviders.PhysicalFileProvider physicalFileProvider)
|
||||
continue;
|
||||
if (!physicalFileProvider.Root.Contains("UserSecrets"))
|
||||
continue;
|
||||
throw new NotSupportedException(physicalFileProvider.Root);
|
||||
paths.Add(physicalFileProvider.Root);
|
||||
}
|
||||
throw new NotSupportedException("Not Found!");
|
||||
throw new NotSupportedException($"Not found!{Environment.NewLine}{string.Join(Environment.NewLine, paths.Distinct())}");
|
||||
}
|
||||
}
|
||||
|
||||
@ -48,6 +48,7 @@ public class AppSettings
|
||||
if (appSettings.RequireRootDirectoryExists is null) throw new NullReferenceException(nameof(appSettings.RequireRootDirectoryExists));
|
||||
Verify(appSettings);
|
||||
result = new(appSettings.Company,
|
||||
appSettings.HarFilesDirectory,
|
||||
appSettings.MaxDegreeOfParallelism.Value,
|
||||
appSettings.RequireRootDirectoryExists.Value);
|
||||
return result;
|
||||
|
Reference in New Issue
Block a user