wsgidav.dav_provider¶
Description
Abstract base class for DAV resource providers.
This module serves these purposes:
Documentation of the DAVProvider interface
Common base class for all DAV providers
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
|
A DAVCollection is a _DAVResource, that has members (like a 'folder' on a filesystem). |
|
A DAVNonCollection is a _DAVResource, that has content (like a 'file' on a filesystem). |
Abstract base class for DAV resource providers. |
Other Members
|
int([x]) -> integer int(x, base=10) -> integer |
|
int([x]) -> integer int(x, base=10) -> integer |
|
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str |