Exemplo n.º 1
0
        private static List <T> ReadObjectFromBucket <T>(RegionEndpoint regionEndpoint, string bucketName, S3Object s3Object) where T : Log
        {
            if (!IsFolder(s3Object))
            {
                var logs = SimpleStorageService.ReadLogsFromBucket(regionEndpoint, bucketName, s3Object.Key);

                var deserializedLogs = Deserialize <T>(logs.Result);
                return(deserializedLogs);
            }
            return(null);
        }
Exemplo n.º 2
0
        private static async Task <ListObjectsResponse> ReadObjectsFromBucket(RegionEndpoint regionEndpoint, string bucketName, string prefix)
        {
            using (var client = SimpleStorageService.GetClient(regionEndpoint))
            {
                ListObjectsRequest request = new ListObjectsRequest
                {
                    BucketName = bucketName,
                    Prefix     = prefix
                };

                return(await client.ListObjectsAsync(request));
            }
        }