public async IAsyncEnumerable <IReadOnlyCollection <FileListItem> > List(StringPath path = null, bool allDirectories = false) { BlobContinuationToken token = null; do { var p = path != null?BasePathSansContainer.Add(path) : BasePathSansContainer; var res = await Container.ListBlobsSegmentedAsync(p + "/", allDirectories, BlobListingDetails.None, null, token, null, null); var items = res.Results.OfType <ICloudBlob>().Select(r => new FileListItem { Path = new StringPath(r.Uri.AbsolutePath).RelativePath(BasePath), Modified = r.Properties.LastModified }); yield return(items.ToReadOnly()); token = res.ContinuationToken; } while (token != null); }
string ContainerRelativePath(StringPath path = null) => path == null ? BasePathSansContainer : BasePathSansContainer.Add(path);
public CloudBlockBlob BlobRef(StringPath path) => Container.GetBlockBlobReference(BasePathSansContainer.Add(path));