listAllBuckets method

Future<List<String>> listAllBuckets()

Implementation

Future<List<String>> listAllBuckets() async {
  xml.XmlDocument doc = await getUri(Uri.parse(endpointUrl + '/'));
  List<String> res = [];
  for (xml.XmlElement root in doc.findElements('ListAllMyBucketsResult')) {
    for (xml.XmlElement buckets in root.findElements('Buckets')) {
      for (xml.XmlElement bucket in buckets.findElements('Bucket')) {
        for (xml.XmlElement name in bucket.findElements('Name')) {
          res.add(name.text);
        }
      }
    }
  }
  return res;
}