Attention

You are looking at outdated documentation for version 2.x. A newer version is available.

wsgidav.samples.dav_provider_tools.FileResource.delete

FileResource.delete()

Remove this resource (recursive).

Preconditions (ensured by caller):

  • there are no conflicting locks or If-headers
  • if supportRecursiveDelete() is False, and this is a collection, all members have already been deleted.

When supportRecursiveDelete is True, this method must be prepared to handle recursive deletes. This implies that child errors must be reported as tuple list [ (<ref-url>, <DAVError>), … ]. See http://www.webdav.org/specs/rfc4918.html#delete-collections

This function

  • removes this resource
  • if this is a non-empty collection, also removes all members. Note that this may only occur, if supportRecursiveDelete is True.
  • For recursive deletes, return a list of error tuples for all failed resource paths.
  • removes associated direct locks
  • removes associated dead properties
  • raises HTTP_FORBIDDEN for read-only resources
  • raises HTTP_INTERNAL_ERROR on error

This method MUST be implemented by all providers that support write access.