Smb save servers, auth

This commit is contained in:
2022-02-10 11:24:04 +01:00
parent 70180b9f12
commit ec03067af1
19 changed files with 463 additions and 132 deletions

View File

@@ -55,25 +55,6 @@ namespace FileTime.Providers.Smb
public Task<IContainer> Clone() => Task.FromResult((IContainer)this);
public async Task<IItem?> GetByPath(string path, bool acceptDeepestMatch = false)
{
var paths = path.Split(Constants.SeparatorChar);
var item = (await GetItems())?.FirstOrDefault(i => i.Name == paths[0]);
if (paths.Length == 1)
{
return item;
}
if (item is IContainer container)
{
return await container.GetByPath(string.Join(Constants.SeparatorChar, paths.Skip(1)), acceptDeepestMatch);
}
return null;
}
public IContainer? GetParent() => _parent;
public Task<bool> IsExists(string name)