AWS SDK for .NET Documentation
ListObjectsResponse Class
AmazonAmazon.S3.ModelListObjectsResponse Did this page help you?   Yes   No    Tell us about it...
The ListObjectsResponse contains the list of S3Objects in the bucket and any headers returned by S3.
Declaration Syntax
public class ListObjectsResponse : S3Response
All MembersConstructorsMethodsProperties

Initializes a new instance of the ListObjectsResponse class

Gets and sets the AmazonId2 property. This property corresponds to the x-amz-id-2 header in the HTTP response from the Amazon S3 service. The value of this header is used for internal troubleshooting purposes.
(Inherited from S3Response.)
CommonPrefix Obsolete.
Returns the list of common prefixes returned by S3. This property has been deprecated. Please use the CommonPrefixes property instead. 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/.

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.

Disposes of all managed and unmanaged resources.
(Inherited from S3Response.)
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Serves as a hash function for a particular type.
(Inherited from Object.)
Gets the type of the current instance.
(Inherited from Object.)
Gets and sets the Headers property. Information like the request-id, the amz-id-2 are retrieved fro the Headers and presented to the user via properties of the response object.
(Inherited from S3Response.)
Gets and Sets the IsTruncated property. This property governs whether this is the last set of items that match the specified criteria or whether you need to make another call to S3 to retrieve more keys.

Gets and sets the MaxKeys property. This is the maximum number of keys in the S3Objects collection. The value is derived from the MaxKeys parameter to ListObjectsRequest.

Gets and sets the Metadata property.
(Inherited from S3Response.)
Gets and sets the Name property. The bucket's name.

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.

Gets and sets the Prefix property. Keys that begin with the indicated prefix are listed.

Gets and sets the RequestId property.
(Inherited from S3Response.)
Gets and sets the ResponseStream property. This property only has a valid value for GetObjectResponses. In order to use this stream without leaking the underlying resource, please wrap access to the stream within a using block.
(Inherited from S3Response.)
Gets and sets the ResponseXml property. This is the original xml response received from S3
(Inherited from S3Response.)
Gets the S3Objects property. This is a list of objects in the bucket that match your search criteria.

Gets the HTTP Status code from the service response.
(Inherited from S3Response.)
String Representation of this object. Overrides Object.ToString()
(Inherited from S3Response.)

This example shows how to list all objects in a bucket.

CopyListObjects sample
// Create a client
AmazonS3Client client = new AmazonS3Client();

// List all objects
ListObjectsRequest listRequest = new ListObjectsRequest
    BucketName = "SampleBucket",

ListObjectsResponse listResponse;
    // 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);
Inheritance Hierarchy
See Also

Assembly: AWSSDK (Module: AWSSDK) Version: (