Skip to content

Commit

Permalink
Renames default file system to LocalFileSystem
Browse files Browse the repository at this point in the history
  • Loading branch information
sakari-malkki committed Sep 13, 2024
1 parent e4b9ae9 commit 235813e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Px.Utils/Validation/DataValidation/DataValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public ValidationResult Validate(
bool leaveStreamOpen = false,
IFileSystem? fileSystem = null)
{
fileSystem ??= new FileSystem();
fileSystem ??= new LocalFileSystem();
encoding ??= fileSystem.GetEncoding(stream);
SetValidationParameters(encoding, filename);

Expand Down Expand Up @@ -99,7 +99,7 @@ public async Task<ValidationResult> ValidateAsync(
IFileSystem? fileSystem = null,
CancellationToken cancellationToken = default)
{
fileSystem ??= new FileSystem();
fileSystem ??= new LocalFileSystem();
encoding ??= await fileSystem.GetEncodingAsync(stream, cancellationToken);
SetValidationParameters(encoding, filename);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class DatabaseValidator(
private readonly IDatabaseValidator[]? _customPxFileValidators = customPxFileValidators;
private readonly IDatabaseValidator[]? _customAliasFileValidators = customAliasFileValidators;
private readonly IDatabaseValidator[]? _customDirectoryValidators = customDirectoryValidators;
private readonly IFileSystem _fileSystem = fileSystem is not null ? fileSystem : new FileSystem();
private readonly IFileSystem _fileSystem = fileSystem is not null ? fileSystem : new LocalFileSystem();

private readonly ValidationFeedback feedbacks = [];
private readonly ConcurrentBag<DatabaseFileInfo> pxFiles = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Px.Utils.Validation.DatabaseValidation
/// Default file system used for database validation process. Contains default implementations of numerous IO operations
/// and a function for determining a file's encoding format.
/// </summary>
public class FileSystem : IFileSystem
public class LocalFileSystem : IFileSystem
{
public IEnumerable<string> EnumerateFiles(string path, string searchPattern)
{
Expand Down
4 changes: 2 additions & 2 deletions Px.Utils/Validation/SyntaxValidation/SyntaxValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public SyntaxValidationResult Validate(
bool leaveStreamOpen = false,
IFileSystem? fileSystem = null)
{
fileSystem ??= new FileSystem();
fileSystem ??= new LocalFileSystem();
encoding ??= fileSystem.GetEncoding(stream);

SyntaxValidationFunctions validationFunctions = new();
Expand Down Expand Up @@ -86,7 +86,7 @@ public async Task<SyntaxValidationResult> ValidateAsync(
IFileSystem? fileSystem = null,
CancellationToken cancellationToken = default)
{
fileSystem ??= new FileSystem();
fileSystem ??= new LocalFileSystem();
encoding ??= await fileSystem.GetEncodingAsync(stream, cancellationToken);

SyntaxValidationFunctions validationFunctions = new();
Expand Down

0 comments on commit 235813e

Please sign in to comment.