wsgidav.dav_provider#

Description

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.is_collection, res.get_content_length(), and res.support_etag().

It also implements operations, that require an existing resource, like: get_preferred_path(), create_collection(), or get_property_value().

Usage:

res = provider.get_resource_inst(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.get_resource_inst(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 prop_man.property_manager.PropertyManager for a sample implementation using shelve.

lockManager

An object that implements locking on webDAV resources. It contains an instance of LockStorageDict

lockStorage

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

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

See lock_storage for a sample implementation using shelve.

See reference_guide for more information about the WsgiDAV architecture.

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.

Other Members

HTTP_FORBIDDEN

int([x]) -> integer int(x, base=10) -> integer

HTTP_NOT_FOUND

int([x]) -> integer int(x, base=10) -> integer

PRECONDITION_CODE_ProtectedProperty

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str