proppatch method

Future<bool> proppatch(
  1. PathUri path, {
  2. WebDavProp? set,
  3. WebDavPropWithoutValues? remove,
})

Updates the props of the resource at path.

The props in set will be updated. The props in remove will be removed. Returns true if the update was successful. See:

Implementation

Future<bool> proppatch(
  PathUri path, {
  WebDavProp? set,
  WebDavPropWithoutValues? remove,
}) async {
  final request = proppatch_Request(
    path,
    set: set,
    remove: remove,
  );

  final streamedResponse = await csrfClient.send(request);
  final response = await http.Response.fromStream(streamedResponse);
  final data = const WebDavResponseConverter().convert(response);
  for (final a in data.responses) {
    for (final b in a.propstats) {
      if (!b.status.contains('200')) {
        return false;
      }
    }
  }
  return true;
}