public async Task <Stream> OpenReadAsync(string fullPath, CancellationToken cancellationToken = default)
        {
            fullPath = StoragePath.Normalize(fullPath, true);

            var ms = new MemoryStream(0);
            await _dbfs.Download(fullPath, ms);

            return(ms);
        }
예제 #2
0
        public async Task <Stream> OpenReadAsync(string fullPath, CancellationToken cancellationToken = default)
        {
            fullPath = StoragePath.Normalize(fullPath);

            var ms = new MemoryStream(0);

            try
            {
                await _dbfs.Download(fullPath, ms).ConfigureAwait(false);
            }
            catch (ClientApiException ex) when(ex.StatusCode == HttpStatusCode.NotFound || ex.StatusCode == HttpStatusCode.BadRequest)
            {
                return(null);
            }
            ms.Position = 0;

            return(ms);
        }