SMB, GUI imput handler, ThreadSafe SMB

This commit is contained in:
2022-02-01 13:03:00 +01:00
parent c2dcb49016
commit 9824184d90
10 changed files with 265 additions and 48 deletions

View File

@@ -63,9 +63,21 @@ namespace FileTime.Providers.Smb
throw new NotSupportedException();
}
public Task<IItem?> GetByPath(string path)
public async Task<IItem?> GetByPath(string path)
{
throw new NotImplementedException();
if (path == null) return this;
var pathParts = path.TrimStart(Constants.SeparatorChar).Split(Constants.SeparatorChar);
var rootContainer = _rootContainers.Find(c => c.Name == pathParts[0]);
if (rootContainer == null)
{
return null;
}
var remainingPath = string.Join(Constants.SeparatorChar, pathParts.Skip(1));
return remainingPath.Length == 0 ? rootContainer : await rootContainer.GetByPath(remainingPath);
}
public IContainer? GetParent() => _parent;