AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.
Namespace: Amazon.S3.Model
Assembly: AWSSDK.dll
Version: (assembly version)
public class ListObjectsResponse : AmazonWebServiceResponse
The ListObjectsResponse type exposes the following members
Name | Description | |
---|---|---|
ListObjectsResponse() |
Name | Type | Description | |
---|---|---|---|
CommonPrefixes | System.Collections.Generic.List<System.String> | Gets the CommonPrefixes property. A response can contain CommonPrefixes only if you specify a delimiter. When you do, CommonPrefixes contains all (if there are any) keys between Prefix and the next occurrence of the string specified by delimiter. In effect, CommonPrefixes lists keys that act like subdirectories in the directory specified by Prefix. For example, if prefix is notes/ and delimiter is a slash (/), in notes/summer/july, the common prefix is notes/summer/. | |
ContentLength | System.Int64 | Inherited from Amazon.Runtime.AmazonWebServiceResponse. | |
Delimiter | System.String | Gets and sets the Delimiter property. Causes keys that contain the same string between the prefix and the first occurrence of the delimiter to be rolled up into a single result element in the CommonPrefixes collection. | |
HttpStatusCode | System.Net.HttpStatusCode | Inherited from Amazon.Runtime.AmazonWebServiceResponse. | |
IsTruncated | System.Boolean | A flag that indicates whether or not Amazon S3 returned all of the results that satisfied the search criteria. | |
MaxKeys | System.Int32 | ||
Name | System.String | ||
NextMarker | System.String | Gets and sets the NextMarker property. NextMarker is set by S3 only if a Delimiter was specified in the original ListObjects request. If a delimiter was not specified, the AWS SDK for .NET returns the last Key of the List of Objects retrieved from S3 as the NextMarker. | |
Prefix | System.String | ||
ResponseMetadata | Amazon.Runtime.ResponseMetadata | Inherited from Amazon.Runtime.AmazonWebServiceResponse. | |
S3Objects | System.Collections.Generic.List<Amazon.S3.Model.S3Object> | Gets the S3Objects property. This is a list of objects in the bucket that match your search criteria. |
This example shows how to list all objects in a bucket.
// Create a client AmazonS3Client client = new AmazonS3Client(); // List all objects ListObjectsRequest listRequest = new ListObjectsRequest { BucketName = "SampleBucket", }; ListObjectsResponse listResponse; do { // Get a list of objects listResponse = client.ListObjects(listRequest); foreach (S3Object obj in listResponse.S3Objects) { Console.WriteLine("Object - " + obj.Key); Console.WriteLine(" Size - " + obj.Size); Console.WriteLine(" LastModified - " + obj.LastModified); Console.WriteLine(" Storage class - " + obj.StorageClass); } // Set the marker property listRequest.Marker = listResponse.NextMarker; } while (listResponse.IsTruncated);
.NET Framework:
Supported in: 4.5, 4.0, 3.5
.NET for Windows Store apps:
Supported in: Windows 8.1, Windows 8
.NET for Windows Phone:
Supported in: Windows Phone 8.1, Windows Phone 8