public static async Task <Node <ItemInfo> > GetItemsTreeAsync(this IHosting hosting, UPath path) { if (!await hosting.IsExistAsync(path)) { throw new ItemNotFound(); } if (await hosting.IsFileAsync(path)) { return(new Node <ItemInfo>(await hosting.GetItemInfoAsync(path))); } return(await hosting.GetDirectoryItemsTreeAsync(path)); }