Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,12 @@ namespace Aws
const Aws::String GetVersionId() const { std::lock_guard<std::mutex> locker(m_getterSetterLock); return m_versionId; }
void SetVersionId(const Aws::String& versionId) { std::lock_guard<std::mutex> locker(m_getterSetterLock); m_versionId = versionId; }

/**
* (Download only) ETAG of the object to retrieve.
*/
const Aws::String GetEtag() const { std::lock_guard<std::mutex> locker(m_getterSetterLock); return m_etag; }
void SetEtag(const Aws::String& etag) { std::lock_guard<std::mutex> locker(m_getterSetterLock); m_etag = etag; }

/**
* Upload or Download?
*/
Expand Down Expand Up @@ -405,6 +411,7 @@ namespace Aws
Aws::String m_fileName;
Aws::String m_contentType;
Aws::String m_versionId;
Aws::String m_etag;
Aws::Map<Aws::String, Aws::String> m_metadata;
TransferStatus m_status;
Aws::Client::AWSError<Aws::S3::S3Errors> m_lastError;
Expand Down
2 changes: 2 additions & 0 deletions src/aws-cpp-sdk-transfer/source/transfer/TransferManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -931,6 +931,7 @@ namespace Aws
handle->SetBytesTotalSize(downloadSize);
handle->SetContentType(headObjectOutcome.GetResult().GetContentType());
handle->SetMetadata(headObjectOutcome.GetResult().GetMetadata());
handle->SetEtag(headObjectOutcome.GetResult().GetETag());
/* When bucket versioning is suspended, head object will return "null" for unversioned object.
* Send following GetObject with "null" as versionId will result in 403 access denied error if your IAM role or policy
* doesn't have GetObjectVersion permission.
Expand Down Expand Up @@ -1012,6 +1013,7 @@ namespace Aws
getObjectRangeRequest.WithKey(handle->GetKey());
getObjectRangeRequest.SetRange(FormatRangeSpecifier(rangeStart, rangeEnd));
getObjectRangeRequest.SetResponseStreamFactory(responseStreamFunction);
getObjectRangeRequest.SetIfMatch(handle->GetEtag());
if(handle->GetVersionId().size() > 0)
{
getObjectRangeRequest.SetVersionId(handle->GetVersionId());
Expand Down
Loading