Returns information about the ListObjects response and response metadata.
Inheritance Hierarchy
Namespace: Amazon.S3.Model
Assembly: AWSSDK.dll
Version: 2.0.0.3
Syntax
public class ListObjectsResponse : AmazonWebServiceResponse
The ListObjectsResponse type exposes the following members
Constructors
Name | Description | |
---|---|---|
![]() |
ListObjectsResponse() |
Properties
Name | Description | |
---|---|---|
![]() |
CommonPrefixes | 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 | Returns the content length of the HTTP response. |
![]() |
Delimiter | 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 | Returns the status code of the HTTP response. |
![]() |
IsTruncated | A flag that indicates whether or not Amazon S3 returned all of the results that satisfied the search criteria. |
![]() |
MaxKeys | |
![]() |
Name | |
![]() |
NextMarker | 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 | |
![]() |
ResponseMetadata | Contains additional information about the request, such as the Request Id. |
![]() |
S3Objects | Gets the S3Objects property. This is a list of objects in the bucket that match your search criteria. |
Examples
This example shows how to list all objects in a bucket.
ListObjects sample
// 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);
Version Information
.NET Framework:
Supported in: 4.5, 4.0, 3.5
.NET for Windows Store apps:
Supported in: Windows 8
.NET for Windows Phone:
Supported in: Window Phone 8