public async Task <Stream> DownloadAsync(ISpaceFile file, CancellationToken cancellationToken) { using var client = _factory.Create(_options); var response = await client.GetObjectAsync($@"{_options.BucketName}/{file.CreatedAt:yyyy/MM}", file.Key, cancellationToken); return(response.ResponseStream); }
public async Task DeleteAsync(ISpaceFile file, CancellationToken cancellationToken) { using var client = _factory.Create(_options); var bucketName = $@"{_options.BucketName}/{file.CreatedAt:yyyy/MM}"; await client.CopyObjectAsync( bucketName, file.Key, $@"{_options.BucketName}/{file.CreatedAt:yyyy/MM}/deleted", file.Key, cancellationToken); }