Attention

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

5.5.3.1.2. wsgidav.dav_provider

Abstract base class for DAV resource providers.

This module serves these purposes:

  1. Documentation of the DAVProvider interface
  2. Common base class for all DAV providers
  3. Default implementation for most functionality that a resource provider must deliver.

If no default implementation can be provided, then all write actions generate FORBIDDEN errors. Read requests generate NOT_IMPLEMENTED errors.

_DAVResource, DAVCollection, DAVNonCollection

Represents an existing (i.e. mapped) WebDAV resource or collection.

A _DAVResource object is created by a call to the DAVProvider.

The resource may then be used to query different attributes like res.name, res.isCollection, res.getContentLength(), and res.supportEtag().

It also implements operations, that require an existing resource, like: getPreferredPath(), createCollection(), or getPropertyValue().

Usage:

res = provider.getResourceInst(path, environ)
if res is not None:
    print res.getName()

DAVProvider

A DAV provider represents a shared WebDAV system.

There is only one provider instance per share, which is created during server start-up. After that, the dispatcher (request_resolver.RequestResolver) parses the request URL and adds it to the WSGI environment, so it can be accessed like this:

provider = environ["wsgidav.provider"]

The main purpose of the provider is to create _DAVResource objects for URLs:

res = provider.getResourceInst(path, environ)

Supporting Objects The DAVProvider takes two supporting objects:

propertyManager

An object that provides storage for dead properties assigned for webDAV resources.

PropertyManagers must provide the methods as described in wsgidav.interfaces.propertymanagerinterface

See property_manager.PropertyManager for a sample implementation using shelve.

lockmMnager

An object that provides storage for locks made on webDAV resources.

LockManagers must provide the methods as described in wsgidav.interfaces.lockmanagerinterface

See lock_manager.LockManager for a sample implementation using shelve.

See Developers info for more information about the WsgiDAV architecture.

Functions

asDAVError(e) Convert any non-DAVError exception to HTTP_INTERNAL_ERROR.

Classes

DAVCollection(path, environ) A DAVCollection is a _DAVResource, that has members (like a ‘folder’ on a filesystem).
DAVNonCollection(path, environ) A DAVNonCollection is a _DAVResource, that has content (like a ‘file’ on a filesystem).
DAVProvider() Abstract base class for DAV resource providers.

Exceptions

DAVError(statusCode[, contextinfo, …])