Table of Contents

Class GetObjectResponse

Namespace
Amazon.S3.Model
Assembly
AWSSDK.S3.dll

Returns information about the GetObject response and response metadata.

public class GetObjectResponse : StreamResponse, IDisposable
Inheritance
GetObjectResponse
Implements
Inherited Members

Constructors

GetObjectResponse()

public GetObjectResponse()

Properties

AcceptRanges

Gets and sets the AcceptRanges.

public string AcceptRanges { get; set; }

Property Value

string

BucketName

Gets and sets the BucketName property.

public string BucketName { get; set; }

Property Value

string

ContentRange

Gets and sets the ContentRange.

public string ContentRange { get; set; }

Property Value

string

DeleteMarker

Specifies whether the object retrieved was (true) or was not (false) a Delete Marker. If false, this response header does not appear in the response.

public string DeleteMarker { get; set; }

Property Value

string

ETag

An ETag is an opaque identifier assigned by a web server to a specific version of a resource found at a URL

public string ETag { get; set; }

Property Value

string

Expiration

Gets and sets the Expiration property. Specifies the expiration date for the object and the rule governing the expiration. Is null if expiration is not applicable.

public Expiration Expiration { get; set; }

Property Value

Expiration

Expires

The date and time at which the object is no longer cacheable.

public DateTime Expires { get; set; }

Property Value

DateTime

Headers

The collection of headers for the request.

public HeadersCollection Headers { get; }

Property Value

HeadersCollection

Key

Gets and sets the Key property.

public string Key { get; set; }

Property Value

string

LastModified

Last modified date of the object

public DateTime LastModified { get; set; }

Property Value

DateTime

Metadata

The collection of meta data for the request.

public MetadataCollection Metadata { get; }

Property Value

MetadataCollection

MissingMeta

This is set to the number of metadata entries not returned in x-amz-meta headers. This can happen if you create metadata using an API like SOAP that supports more flexible metadata than the REST API. For example, using SOAP, you can create metadata whose values are not legal HTTP headers.

public int MissingMeta { get; set; }

Property Value

int

ObjectLockLegalHoldStatus

Gets and sets the property ObjectLockLegalHoldStatus.

public ObjectLockLegalHoldStatus ObjectLockLegalHoldStatus { get; set; }

Property Value

ObjectLockLegalHoldStatus

ObjectLockMode

Gets and sets the property ObjectLockMode.

The Object Lock mode currently in place for this object.

public ObjectLockMode ObjectLockMode { get; set; }

Property Value

ObjectLockMode

ObjectLockRetainUntilDate

Gets and sets the property ObjectLockRetainUntilDate.

The date and time when this object's Object Lock will expire.

public DateTime ObjectLockRetainUntilDate { get; set; }

Property Value

DateTime

PartsCount

The number of parts this oject has.

public int? PartsCount { get; set; }

Property Value

int?

ReplicationStatus

The status of the replication job associated with this source object.

public ReplicationStatus ReplicationStatus { get; set; }

Property Value

ReplicationStatus

RequestCharged

If present, indicates that the requester was successfully charged for the request.

public RequestCharged RequestCharged { get; set; }

Property Value

RequestCharged

RestoreExpiration

Gets and sets the RestoreExpiration property. RestoreExpiration will be set for objects that have been restored from Amazon Glacier.
It indiciates for those objects how long the restored object will exist.

public DateTime? RestoreExpiration { get; set; }

Property Value

DateTime?

RestoreInProgress

Gets and sets the RestoreInProgress Will be true when the object is in the process of being restored from Amazon Glacier.

public bool RestoreInProgress { get; set; }

Property Value

bool

ServerSideEncryptionCustomerMethod

The Server-side encryption algorithm to be used with the customer provided key.

public ServerSideEncryptionCustomerMethod ServerSideEncryptionCustomerMethod { get; set; }

Property Value

ServerSideEncryptionCustomerMethod

ServerSideEncryptionKeyManagementServiceKeyId

The id of the AWS Key Management Service key that Amazon S3 uses to encrypt and decrypt the object.

public string ServerSideEncryptionKeyManagementServiceKeyId { get; set; }

Property Value

string

ServerSideEncryptionMethod

The Server-side encryption algorithm used when storing this object in S3.

public ServerSideEncryptionMethod ServerSideEncryptionMethod { get; set; }

Property Value

ServerSideEncryptionMethod

StorageClass

The class of storage used to store the object.

public S3StorageClass StorageClass { get; set; }

Property Value

S3StorageClass

TagCount

The number of tags, if any, on the object.

public int TagCount { get; set; }

Property Value

int

VersionId

Version of the object.

public string VersionId { get; set; }

Property Value

string

WebsiteRedirectLocation

If the bucket is configured as a website, redirects requests for this object to another object in the same bucket or to an external URL. Amazon S3 stores the value of this header in the object metadata.

public string WebsiteRedirectLocation { get; set; }

Property Value

string

Methods

WriteResponseStreamToFileAsync(string, bool, CancellationToken)

Writes the content of the ResponseStream a file indicated by the filePath argument.

public Task WriteResponseStreamToFileAsync(string filePath, bool append, CancellationToken cancellationToken)

Parameters

filePath string

The location where to write the ResponseStream

append bool

Whether or not to append to the file if it exists

cancellationToken CancellationToken

Cancellation token which can be used to cancel this operation.

Returns

Task

Events

WriteObjectProgressEvent

The event for Write Object progress notifications. All subscribers will be notified when a new progress event is raised.

public event EventHandler<WriteObjectProgressArgs> WriteObjectProgressEvent

Event Type

EventHandler<WriteObjectProgressArgs>

Remarks

Subscribe to this event if you want to receive put object progress notifications. Here is how:

  1. Define a method with a signature similar to this one:
private void displayProgress(object sender, WriteObjectProgressArgs args)
{
    Console.WriteLine(args);
}
  1. Add this method to the Put Object Progress Event delegate's invocation list
GetObjectResponse response = s3Client.GetObject(request);
response.WriteObjectProgressEvent += displayProgress;