multiget method

Future<CalResponse> multiget(
  1. String path,
  2. List<String> files, {
  3. int? depth,
})

calendar-multiget REPORT is used to retrieve specific calendar object resources from within a collection, if the Request- URI is a collection, or to retrieve a specific calendar object resource, if the Request-URI is a calendar object resource.

Implementation

Future<CalResponse> multiget(String path, List<String> files, {int? depth}) {
  var links = '';

  files.forEach((file) {
    links += '<d:href>' + join(path, file) + '</d:href>\n';
  });

  var body = '''
  <c:calendar-multiget xmlns:d="DAV:" xmlns:c="urn:ietf:params:xml:ns:caldav">
    <d:prop>
      <d:getetag />
      <c:calendar-data />
    </d:prop>
    ''' +
      links +
      '''
  </c:calendar-multiget>
  ''';

  return report(path, body, depth: depth);
}