Content.fromElement constructor

Content.fromElement(XmlElement contentElem)

Implementation

factory Content.fromElement(xml.XmlElement contentElem) {
  final keyElem = contentElem.findElements('Key').first;
  final lastModifiedElem = contentElem.findElements('LastModified').first;
  final etagElem = contentElem.findElements('ETag').first;
  final sizeElem = contentElem.findElements('Size').first;
  final ownerElem = contentElem.findElements('Owner').first;
  final storageClassElem = contentElem.findElements('StorageClass').first;
  final owner = new User.fromElement(ownerElem);
  final lastModified = DateTime.parse(lastModifiedElem.text);
  final size = int.parse(sizeElem.text);
  return new Content(keyElem.text, lastModified, etagElem.text, size, owner,
      storageClassElem.text);
}