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.
Returns information about the ListObjects response and response metadata.
Namespace: Amazon.S3.Model
Assembly: AWSSDK.S3.dll
Version: 3.x.y.z
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 |
Gets and sets the MaxKeys property. This is max number of object keys returned by the list operation. |
|
Name | System.String |
The bucket name. |
|
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 |
Gets and sets the Prefix property. |
|
RequestCharged | Amazon.S3.RequestCharged |
Gets and sets the property RequestCharged. |
|
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:
Supported in: 8.0 and newer, Core 3.1
.NET Standard:
Supported in: 2.0
.NET Framework:
Supported in: 4.5 and newer, 3.5