Attention

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

wsgidav.samples.virtual_dav_provider.VirtualResFile.copyMoveSingle

VirtualResFile.copyMoveSingle(destPath, isMove)

Copy or move this resource to destPath (non-recursive).

Preconditions (ensured by caller):

  • there must not be any conflicting locks on destination
  • overwriting is only allowed (i.e. destPath exists), when source and dest are of the same type ((non-)collections) and a Overwrite=’T’ was passed
  • destPath must not be a child path of this resource

This function

  • Overwrites non-collections content, if destination exists.
  • MUST NOT copy collection members.
  • MUST NOT copy locks.
  • SHOULD copy live properties, when appropriate. E.g. displayname should be copied, but creationdate should be reset if the target did not exist before. See http://www.webdav.org/specs/rfc4918.html#dav.properties
  • SHOULD copy dead properties.
  • raises HTTP_FORBIDDEN for read-only providers
  • raises HTTP_INTERNAL_ERROR on error

When isMove is True,

  • Live properties should be moved too (e.g. creationdate)
  • Non-collections must be moved, not copied
  • For collections, this function behaves like in copy-mode: detination collection must be created and properties are copied. Members are NOT created. The source collection MUST NOT be removed.

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