示例#1
0
        public async Task <string> ReadAllText(string uriString)
        {
            _logger.LogDebug($"Read all text for '{uriString}'.");

            var amazonS3Uri = AmazonS3UriExtensions.ParseAmazonS3Uri(uriString);

            var ms = await GetObjectStream(amazonS3Uri.Bucket, amazonS3Uri.Key, null);

            var bytes = ms.ToArray();
            var text  = Encoding.UTF8.GetString(bytes);

            ms.Dispose();

            _logger.LogDebug($"Read all text for '{uriString}' done.");

            return(text);
        }
示例#2
0
        public async Task <List <S3ObjectModel> > ListObjectsAsync(string uriString)
        {
            var amazonS3Uri = AmazonS3UriExtensions.ParseAmazonS3Uri(uriString);

            return(await ListObjectsAsync(amazonS3Uri.Bucket, amazonS3Uri.Key));
        }