S3ObjectMetadata.fromXml constructor
S3ObjectMetadata.fromXml(
- XmlElement elem
Implementation
factory S3ObjectMetadata.fromXml(_s.XmlElement elem) {
return S3ObjectMetadata(
cacheControl: _s.extractXmlStringValue(elem, 'CacheControl'),
contentDisposition: _s.extractXmlStringValue(elem, 'ContentDisposition'),
contentEncoding: _s.extractXmlStringValue(elem, 'ContentEncoding'),
contentLanguage: _s.extractXmlStringValue(elem, 'ContentLanguage'),
contentLength: _s.extractXmlIntValue(elem, 'ContentLength'),
contentMD5: _s.extractXmlStringValue(elem, 'ContentMD5'),
contentType: _s.extractXmlStringValue(elem, 'ContentType'),
httpExpiresDate: _s.extractXmlDateTimeValue(elem, 'HttpExpiresDate'),
requesterCharged: _s.extractXmlBoolValue(elem, 'RequesterCharged'),
sSEAlgorithm:
_s.extractXmlStringValue(elem, 'SSEAlgorithm')?.toS3SSEAlgorithm(),
userMetadata: Map.fromEntries(
elem.getElement('UserMetadata')?.findElements('entry').map(
(c) => MapEntry(
_s.extractXmlStringValue(c, 'key')!,
_s.extractXmlStringValue(c, 'value')!,
),
) ??
{},
),
);
}