wsgidav.samples.virtual_dav_provider.RootCollection.handle_copy

RootCollection.handle_copy(dest_path, *, depth_infinity)

Handle a COPY request natively.

This method is called by the COPY handler after checking for valid request syntax and making sure that there are no conflicting locks and If-headers. Depending on the return value, this provider can control further processing:

False:

handle_copy() did not do anything. WsgiDAV will process the request by calling copy_move_single() for every resource, bottom-up.

True:

handle_copy() has successfully performed the COPY request. HTTP_NO_CONTENT/HTTP_CREATED will be reported to the DAV client.

List of errors:

handle_copy() tried to perform the copy request, but failed completely or partially. A list of errors is returned like [ (<ref-url>, <DAVError>), ... ] These errors will be reported to the client.

DAVError raised:

handle_copy() refuses to perform the copy request. The DAVError will be reported to the client.

An implementation may choose to apply other semantics and return True. For example copying ‘/by_tag/cool/myres’ to ‘/by_tag/hot/myres’ may simply add a ‘hot’ tag. In this case, the resource might still be available by other URLs, so locks and properties are not removed.

This default implementation returns False, so standard processing takes place.

Implementation of this method is OPTIONAL.