WebDavHandler Module Introduction
This module provides a WebDavHandler server API.
Classes provided by this module:
- AbstractWebDavHandler
- AbstractWebDavPropertyHandler
- DummyWebDavHandler
- FsWebDavHandler
- InMemoryWebDavPropertyHandler
- WebDavHandlerProxy
- Note
- The FsWebDavHandler class does not support any WebDAV locking functionality.
WebDavHandler Example
%new-style
%require-types
%strict-args
%enable-all-warnings
%requires HttpServer
%requires FsUtil
%requires WebDavHandler
%exec-class Main
class Server inherits HttpServer {
private {
int verbose;
int port;
}
constructor(WebDavHandler::AbstractWebDavHandler handler, int verbose = 0) : HttpServer(\log(), \log(), True) {
self.verbose = verbose;
setHandler("webdavhandler", "/", NOTHING, handler);
setDefaultHandler("webdavhandler", handler);
map addHttpMethod($1), handler.getHttpMethods();
port = addListener(<HttpListenerOptionInfo>{"service": 0}).port;
}
log(string str) {
if (verbose > 2) {
printf("%N: %s\n", now_us(), vsprintf(str, argv));
}
}
int getPort() {
return port;
}
}
class Main {
constructor() {
TmpDir tmp("tempdir-");
WebDavHandler::FsWebDavHandler handler(tmp.path);
Server srv(handler, m_options.verbose);
printf("Using tmp path: %s; listening on port %d\n", tmp.path, srv.getPort());
while (True) {
sleep(99999999);
}
}
}
Release Notes
MapperUtil v1.0