86 constructor(*AbstractAuthenticator auth,
string virtual_relative_path_base)
118 hash<HttpResponseInfo>
handleRequest(HttpListenerInterface listener, Socket s, hash<auto> cx, hash<auto> hdr, *data body);
131 hash<HttpResponseInfo>
response(
int response_code = 200, data msg =
'OK');
135 hash<HttpResponseInfo>
response(
int response_code = 200, hash<auto> hdr);
139 hash<HttpResponseInfo>
resp400(data msg =
'Bad Request');
147 hash<HttpResponseInfo>
resp500(data msg =
'General Server Error');
172 *hash<HttpResponseInfo>
checkAuth(
string method, hash<auto> cx, hash<auto> hdr, *data body);
196 hash<auto>
preparePropFindXmlResponse(
string local_path,
string href,
bool is_collection, hash<auto> base_props,
bool all_props = False, *hash<
string, hash<string, bool>> additional_props);
201 hash<auto> propStatXmlHash(
string href, *hash<auto> code_map);
250 hash<HttpResponseInfo>
handleOptions(Socket s, hash<auto> cx, hash<auto> hdr, *data body);
290 hash<HttpResponseInfo>
handleGet(Socket s, hash<auto> cx, hash<auto> hdr, *data body);
330 hash<HttpResponseInfo>
handleHead(Socket s, hash<auto> cx, hash<auto> hdr, *data body);
370 hash<HttpResponseInfo>
handlePost(Socket s, hash<auto> cx, hash<auto> hdr, *data body);
410 hash<HttpResponseInfo>
handlePut(Socket s, hash<auto> cx, hash<auto> hdr, *data body);
450 hash<HttpResponseInfo>
handleDelete(Socket s, hash<auto> cx, hash<auto> hdr, *data body);
490 hash<HttpResponseInfo>
handleCopy(Socket s, hash<auto> cx, hash<auto> hdr, *data body);
530 hash<HttpResponseInfo>
handleMove(Socket s, hash<auto> cx, hash<auto> hdr, *data body);
570 hash<HttpResponseInfo>
handleLock(Socket s, hash<auto> cx, hash<auto> hdr, *data body);
610 hash<HttpResponseInfo>
handleUnlock(Socket s, hash<auto> cx, hash<auto> hdr, *data body);
650 hash<HttpResponseInfo>
handleMkcol(Socket s, hash<auto> cx, hash<auto> hdr, *data body);
691 hash<HttpResponseInfo>
handlePropfind(Socket s, hash<auto> cx, hash<auto> hdr, *data body);
732 hash<HttpResponseInfo>
handleProppatch(Socket s, hash<auto> cx, hash<auto> hdr, *data body);
835 abstract hash<HttpResponseInfo>
handleGetImpl(Socket s, hash<auto> cx, hash<auto> hdr, *data body);
874 abstract hash<HttpResponseInfo>
handleHeadImpl(Socket s, hash<auto> cx, hash<auto> hdr, *data body);
913 abstract hash<HttpResponseInfo>
handlePostImpl(Socket s, hash<auto> cx, hash<auto> hdr, *data body);
952 abstract hash<HttpResponseInfo>
handlePutImpl(Socket s, hash<auto> cx, hash<auto> hdr, *data body);
991 abstract hash<HttpResponseInfo>
handleDeleteImpl(Socket s, hash<auto> cx, hash<auto> hdr, *data body);
1030 abstract hash<HttpResponseInfo>
handleCopyImpl(Socket s, hash<auto> cx, hash<auto> hdr, *data body);
1069 abstract hash<HttpResponseInfo>
handleMoveImpl(Socket s, hash<auto> cx, hash<auto> hdr, *data body);
1108 abstract hash<HttpResponseInfo>
handleLockImpl(Socket s, hash<auto> cx, hash<auto> hdr, *data body);
1147 abstract hash<HttpResponseInfo>
handleUnlockImpl(Socket s, hash<auto> cx, hash<auto> hdr, *data body);
1186 abstract hash<HttpResponseInfo>
handleMkcolImpl(Socket s, hash<auto> cx, hash<auto> hdr, *data body);
1241 abstract *hash<string, hash<string, hash<string, bool>>>
handleProppatchImpl(reference<string> href, hash<auto> cx, hash<auto> hdr, *hash<auto> request_xml, *list<hash<PropPatchActionInfo>> actions); *hash<auto> fixDavPrefixes(
string ns, hash<auto> h, *
string pfx);
1255 string getKey(
string key, *
string nsa);
1260 list<auto> fixDavPrefixes(
string ns, list<auto> l, *
string pfx);
1265 auto fixDavPrefixes(
string ns,
auto v, *
string pfx);
1276 hash<string, string> nsmap = {
1280 hash<string, string> nsrmap = {
1285 thread_local hash<NsInfo> nsinfo;
Abstract WebDavHandler interface class.
Definition: AbstractWebDavHandler.qc.dox.h:40
string getNsPrefix(string ns)
Returns a new namespace prefix.
abstract hash< HttpResponseInfo > handlePutImpl(Socket s, hash< auto > cx, hash< auto > hdr, *data body)
Handles HTTP PUT requests for WebDavHandler resources.
hash< HttpResponseInfo > response(int response_code=200, data msg='OK')
Returns a hash that can be used as an HTTP response with the given HTTP response code and response me...
copyProperties(string source_url, string target_url)
Copies all properties from the given source URL to the target URL.
abstract *hash< string, hash< string, hash< string, bool > > > handleProppatchImpl(reference< string > href, hash< auto > cx, hash< auto > hdr, *hash< auto > request_xml, *list< hash< PropPatchActionInfo >> actions)
Internal method for handling PROPPATCH requests.
const RequestMethods
A hash of all supported WebDavHandler methods mapped to method names.
Definition: AbstractWebDavHandler.qc.dox.h:44
hash< HttpResponseInfo > resp500(data msg='General Server Error')
Returns a hash that can be used as an HTTP response with a 500 response code and response message.
abstract hash< HttpResponseInfo > handlePostImpl(Socket s, hash< auto > cx, hash< auto > hdr, *data body)
Handles HTTP POST requests for WebDavHandler resources.
hash< HttpResponseInfo > handleLock(Socket s, hash< auto > cx, hash< auto > hdr, *data body)
Handles WebDavHandler LOCK requests for WebDavHandler resources.
const AllowHeaderValue
List of WebDavHandler methods in a string suitable for use in HTTP responses.
Definition: AbstractWebDavHandler.qc.dox.h:52
abstract hash< HttpResponseInfo > handleCopyImpl(Socket s, hash< auto > cx, hash< auto > hdr, *data body)
Handles WebDavHandler COPY requests for WebDavHandler resources.
logInfo(string fmt)
This method is called with informational log messages.
hash< HttpResponseInfo > resp404()
Returns a hash that can be used as an HTTP response with a 404 response code and response message.
init(Logger logger, AbstractWebDavPropertyHandler property_handler, string virtual_relative_path_base='/')
Common constructor code.
constructor(*AbstractAuthenticator auth, string virtual_relative_path_base)
Creates the object with the given argument and an in-memory property handler.
hash< HttpResponseInfo > handleOptionsImpl(Socket s, hash< auto > cx, hash< auto > hdr, *data body)
Handles an HTTP/WebDavHandler OPTIONS request.
constructor(*AbstractAuthenticator auth)
Creates the object with an empty logger and an in-memory property handler.
abstract hash< HttpResponseInfo > handleHeadImpl(Socket s, hash< auto > cx, hash< auto > hdr, *data body)
Handles HTTP HEAD requests for WebDavHandler resources.
hash< auto > preparePropFindXmlResponse(string local_path, string href, bool is_collection, hash< auto > base_props, bool all_props=False, *hash< string, hash< string, bool >> additional_props)
Returns a hash that can be serialized to an XML string for a PROPFIND request.
hash< HttpResponseInfo > handleGet(Socket s, hash< auto > cx, hash< auto > hdr, *data body)
Handles HTTP GET requests for WebDavHandler resources.
abstract hash< HttpResponseInfo > handleDeleteImpl(Socket s, hash< auto > cx, hash< auto > hdr, *data body)
Handles HTTP DELETE requests for WebDavHandler resources.
const MethodList
List of WebDavHandler methods.
Definition: AbstractWebDavHandler.qc.dox.h:55
string getStatusMessage(softstring http_code)
Returns a status message for the given HTTP response code.
const DestMethods
A hash of methods that require a Destination header.
Definition: AbstractWebDavHandler.qc.dox.h:48
hash< HttpResponseInfo > handleHead(Socket s, hash< auto > cx, hash< auto > hdr, *data body)
Handles HTTP HEAD requests for WebDavHandler resources.
string getRealPath(string raw_path)
Converts a request path to a normalized real path on the filesystem in the root WebDavHandler directo...
hash< HttpResponseInfo > handlePut(Socket s, hash< auto > cx, hash< auto > hdr, *data body)
Handles HTTP PUT requests for WebDavHandler resources.
hash< HttpResponseInfo > handleUnlock(Socket s, hash< auto > cx, hash< auto > hdr, *data body)
Handles WebDavHandler UNLOCK requests for WebDavHandler resources.
abstract hash< HttpResponseInfo > handleUnlockImpl(Socket s, hash< auto > cx, hash< auto > hdr, *data body)
Handles WebDavHandler UNLOCK requests for WebDavHandler resources.
string getRelativePath(string raw_path)
Returns a relative path from an absolute path.
hash< auto > getXml(string body)
Parse incoming XML and handle namespaces.
logError(string fmt)
This method is called with error log messages.
*hash< HttpResponseInfo > checkAuth(string method, hash< auto > cx, hash< auto > hdr, *data body)
Checks if the request is authorized; if not, this method must return a value.
AbstractWebDavPropertyHandler property_handler
The property handler object.
Definition: AbstractWebDavHandler.qc.dox.h:65
hash< HttpResponseInfo > handleRequest(HttpListenerInterface listener, Socket s, hash< auto > cx, hash< auto > hdr, *data body)
Handles HTTP/WebDavHandler requests and returns the response.
hash< HttpResponseInfo > handleMkcol(Socket s, hash< auto > cx, hash< auto > hdr, *data body)
Handles WebDavHandler MKCOL requests for WebDavHandler resources.
moveProperties(string source_url, string target_url)
Moves all properties from the given source URL to the target URL.
abstract hash< HttpResponseInfo > handleGetImpl(Socket s, hash< auto > cx, hash< auto > hdr, *data body)
Handles HTTP GET requests for WebDavHandler resources.
abstract hash< HttpResponseInfo > handleMoveImpl(Socket s, hash< auto > cx, hash< auto > hdr, *data body)
Handles WebDavHandler MOVE requests for WebDavHandler resources.
hash< HttpResponseInfo > response(int response_code=200, hash< auto > hdr)
Returns a hash that can be used as an HTTP response with the given HTTP response code and response he...
hash< HttpResponseInfo > handlePost(Socket s, hash< auto > cx, hash< auto > hdr, *data body)
Handles HTTP POST requests for WebDavHandler resources.
hash< HttpResponseInfo > handleCopy(Socket s, hash< auto > cx, hash< auto > hdr, *data body)
Handles WebDavHandler COPY requests for WebDavHandler resources.
setLogger(Logger logger)
Replace the logger.
constructor(*AbstractAuthenticator auth, AbstractWebDavPropertyHandler property_handler, string virtual_relative_path_base='/')
Creates the object with the given arguments.
hash< HttpResponseInfo > resp400(data msg='Bad Request')
Returns a hash that can be used as an HTTP response with a 400 response code and response message.
string virtual_base_path
The virtual base path for resources served by the WebDavHandler handler.
Definition: AbstractWebDavHandler.qc.dox.h:68
logDebug(string fmt)
This method is called with debug log messages.
deleteProperties(string source_url)
Deletes all properties from the given URL.
list< string > getHttpMethods()
Returnd a list of WebDavHandler methods.
hash< HttpResponseInfo > handleMove(Socket s, hash< auto > cx, hash< auto > hdr, *data body)
Handles WebDavHandler MOVE requests for WebDavHandler resources.
const PPA_Remove
PROPPATCH action: remove.
Definition: AbstractWebDavHandler.qc.dox.h:58
abstract hash< HttpResponseInfo > handlePropfindImpl(Socket s, hash< auto > cx, hash< auto > hdr, *data body)
Handles WebDavHandler PROPFIND requests for WebDavHandler resources; reetrieves properties from WebDa...
abstract hash< HttpResponseInfo > handleLockImpl(Socket s, hash< auto > cx, hash< auto > hdr, *data body)
Handles WebDavHandler LOCK requests for WebDavHandler resources.
static combineValue(reference< auto > h, auto v)
Combines values recursively.
abstract hash< HttpResponseInfo > handleMkcolImpl(Socket s, hash< auto > cx, hash< auto > hdr, *data body)
Handles WebDavHandler MKCOL requests for WebDavHandler resources.
hash< HttpResponseInfo > handleDelete(Socket s, hash< auto > cx, hash< auto > hdr, *data body)
Handles HTTP DELETE requests for WebDavHandler resources.
hash< HttpResponseInfo > resp501()
Returns a hash that can be used as an HTTP response with a 501 response code and response message.
hash< HttpResponseInfo > handlePropfind(Socket s, hash< auto > cx, hash< auto > hdr, *data body)
Handles WebDavHandler PROPFIND requests for WebDavHandler resources; reetrieves properties from WebDa...
hash< HttpResponseInfo > handleOptions(Socket s, hash< auto > cx, hash< auto > hdr, *data body)
Handles a WebDavHandler OPTIONS request.
const PPA_Set
PROPPATCH action: set.
Definition: AbstractWebDavHandler.qc.dox.h:61
constructor(*AbstractAuthenticator auth, Logger logger, AbstractWebDavPropertyHandler property_handler=new InMemoryWebDavPropertyHandler(), string virtual_relative_path_base='/')
Creates the object with the given arguments.
Logger logger
The Logger for this object.
Definition: AbstractWebDavHandler.qc.dox.h:71
hash< HttpResponseInfo > handleProppatch(Socket s, hash< auto > cx, hash< auto > hdr, *data body)
Handles WebDavHandler PROPPATCH requests for WebDavHandler resources; sets or removes properties on W...
The abstract WebDavHandler property handler class interface.
Definition: AbstractWebDavPropertyHandler.qc.dox.h:27
An in-memory property handler that stores and retrieves all properties in memory.
Definition: InMemoryWebDavPropertyHandler.qc.dox.h:27
Main public WebDavHandler namespace.
Definition: AbstractWebDavHandler.qc.dox.h:26
string prop
Property.
Definition: AbstractWebDavHandler.qc.dox.h:34
auto val
Value.
Definition: AbstractWebDavHandler.qc.dox.h:36
hashdecl PropPatchActionInfo
PROPPATCH action info.
Definition: AbstractWebDavHandler.qc.dox.h:28
const DavNs
WebDavHandler namespace value.
Definition: WebDavHandler.qm.dox.h:116
string ns
Namespace.
Definition: AbstractWebDavHandler.qc.dox.h:32