Qore xml Module 2.1.0
Loading...
Searching...
No Matches
WebDavHandler::FsWebDavHandler Class Reference

Filesystem WebDavHandler inteface class. More...

#include <FsWebDavHandler.qc.dox.h>

Inheritance diagram for WebDavHandler::FsWebDavHandler:
WebDavHandler::AbstractWebDavHandler

Public Member Methods

void constructor (string path, soft< HttpServer::AbstractAuthenticator > auth)
 Creates the object with an empty logger and an in-memory property handler.
 
void constructor (string virtual_relative_path_base, string path, soft< HttpServer::AbstractAuthenticator > auth)
 Creates the object with the given argument and an in-memory property handler.
 
void constructor (AbstractWebDavPropertyHandler property_handler, string virtual_relative_path_base, string path, soft< HttpServer::AbstractAuthenticator > auth)
 Creates the object with the given arguments.
 
void constructor (Logger logger, AbstractWebDavPropertyHandler property_handler, string path, soft< HttpServer::AbstractAuthenticator > auth, string virtual_relative_path_base)
 Creates the object with the given arguments.
 
void init (string path)
 Common constructor initialization.
 
string getRealPath (string raw_path)
 Converts a request path to a normalized real path on the filesystem in the root WebDavHandler directory.
 
soft< string > getContentType (string filePath)
 Returns the content type for the file based on its extension.
 
hash< auto > hstat2Resource (hash< StatInfo > h, string path, string displayname)
 Returns resources for use in a PROPFIND request based on a StatInfo hash.
 
list< hash< auto > > preparePropFindResponse (hash< auto > cx, string depth, soft< hash< string, hash< string, bool > > > additional_props, bool all_props, hash< StatInfo > h)
 Returns responses for each relevant resource.
 
hash< HttpResponseInfo > handleGetImpl (soft< data > body, hash< auto > hdr, Socket s, hash< auto > cx)
 Handles HTTP GET requests for WebDavHandler resources.
 
hash< HttpResponseInfo > handleHeadImpl (soft< data > body, hash< auto > hdr, Socket s, hash< auto > cx)
 Handles HTTP HEAD requests for WebDavHandler resources.
 
hash< HttpResponseInfo > handlePostImpl (soft< data > body, hash< auto > hdr, Socket s, hash< auto > cx)
 Handles HTTP POST requests for WebDavHandler resources.
 
hash< HttpResponseInfo > handlePutImpl (soft< data > body, hash< auto > hdr, Socket s, hash< auto > cx)
 Handles HTTP PUT requests for WebDavHandler resources.
 
hash< HttpResponseInfo > handleDeleteImpl (soft< data > body, hash< auto > hdr, Socket s, hash< auto > cx)
 Handles HTTP DELETE requests for WebDavHandler resources.
 
hash< HttpResponseInfo > handleCopyImpl (soft< data > body, hash< auto > hdr, Socket s, hash< auto > cx)
 Handles WebDavHandler COPY requests for WebDavHandler resources.
 
hash< HttpResponseInfo > handleMoveImpl (soft< data > body, hash< auto > hdr, Socket s, hash< auto > cx)
 Handles WebDavHandler MOVE requests for WebDavHandler resources.
 
hash< HttpResponseInfo > handleLockImpl (soft< data > body, hash< auto > hdr, Socket s, hash< auto > cx)
 Handles WebDavHandler LOCK requests for WebDavHandler resources.
 
hash< HttpResponseInfo > handleLockRefresh (string path, hash< auto > hdr)
 Handles lock refresh requests.
 
int parseTimeout (soft< string > timeout_header)
 Parses the Timeout header value.
 
hash< auto > buildLockDiscoveryResponse (hash< WebDavLockInfo > lock_info)
 Builds the lock discovery XML response.
 
hash< HttpResponseInfo > handleUnlockImpl (soft< data > body, hash< auto > hdr, Socket s, hash< auto > cx)
 Handles WebDavHandler UNLOCK requests for WebDavHandler resources.
 
hash< HttpResponseInfo > handleMkcolImpl (soft< data > body, hash< auto > hdr, Socket s, hash< auto > cx)
 Handles WebDavHandler MKCOL requests for WebDavHandler resources.
 
hash< HttpResponseInfo > handlePropfindImpl (soft< data > body, hash< auto > hdr, Socket s, hash< auto > cx)
 Handles WebDavHandler PROPFIND requests for WebDavHandler resources; reetrieves properties from WebDavHandler resources.
 
soft< hash< string, hash< string, hash< string, bool > > > > handleProppatchImpl (soft< list< hash< PropPatchActionInfo > > > actions, soft< hash< auto > > request_xml, hash< auto > hdr, reference< string > href, hash< auto > cx)
 Internal method for handling PROPPATCH requests.
 
soft< hash< string, hash< string, hash< string, bool > > > > verifyPropertyUpdates (string path, soft< list< hash< PropPatchActionInfo > > > actions)
 Verifies that all property updates can be performed before executing them.
 
hash< HttpResponseInfo > doCopyMoveIntern (bool copy_props, soft< data > body, hash< auto > hdr, Socket s, hash< auto > cx)
 Process copy and moves (without deletion) internally including properties (properties are moved, files are copied)
 
void internalCopyMove (bool copy_props, soft< data > body, hash< auto > hdr, Socket s, hash< auto > cx)
 Copy or move the file and any properties.
 
- Public Member Methods inherited from WebDavHandler::AbstractWebDavHandler
void constructor (soft< AbstractAuthenticator > auth)
 Creates the object with an empty logger and an in-memory property handler.
 
void constructor (soft< AbstractAuthenticator > auth, string virtual_relative_path_base)
 Creates the object with the given argument and an in-memory property handler.
 
void constructor (soft< AbstractAuthenticator > auth, AbstractWebDavPropertyHandler property_handler, string virtual_relative_path_base)
 Creates the object with the given arguments.
 
void constructor (soft< AbstractAuthenticator > auth, Logger logger, AbstractWebDavPropertyHandler property_handler, string virtual_relative_path_base)
 Creates the object with the given arguments.
 
list< string > getHttpMethods ()
 Returnd a list of WebDavHandler methods.
 
void setLogger (Logger logger)
 Replace the logger.
 
string getRelativePath (string raw_path)
 Returns a relative path from an absolute path.
 
hash< HttpResponseInfo > response (int response_code, data msg)
 Returns a hash that can be used as an HTTP response with the given HTTP response code and response message.
 
hash< HttpResponseInfo > response (int response_code, hash< auto > hdr)
 Returns a hash that can be used as an HTTP response with the given HTTP response code and response headers.
 
hash< HttpResponseInfo > resp400 (data msg)
 Returns a hash that can be used as an HTTP response with a 400 response code and response message.
 
hash< HttpResponseInfo > resp404 ()
 Returns a hash that can be used as an HTTP response with a 404 response code and response message.
 
hash< HttpResponseInfo > resp500 (data msg)
 Returns a hash that can be used as an HTTP response with a 500 response code and response message.
 
hash< HttpResponseInfo > resp501 ()
 Returns a hash that can be used as an HTTP response with a 501 response code and response message.
 
void init (Logger logger, AbstractWebDavPropertyHandler property_handler, string virtual_relative_path_base)
 Common constructor code.
 
string getRealPath (string raw_path)
 Converts a request path to a normalized real path on the filesystem in the root WebDavHandler directory.
 
soft< hash< HttpResponseInfo > > checkAuth (soft< data > body, hash< auto > hdr, string method, hash< auto > cx)
 Checks if the request is authorized; if not, this method must return a value.
 
void copyProperties (string source_url, string target_url)
 Copies all properties from the given source URL to the target URL.
 
void moveProperties (string source_url, string target_url)
 Moves all properties from the given source URL to the target URL.
 
void deleteProperties (string source_url)
 Deletes all properties from the given URL.
 
hash< auto > preparePropFindXmlResponse (hash< auto > base_props, bool all_props, soft< hash< string, hash< string, bool > > > additional_props, bool is_collection, string local_path, string href)
 Returns a hash that can be serialized to an XML string for a PROPFIND request.
 
string getStatusMessage (softstring http_code)
 Returns a status message for the given HTTP response code.
 
hash< HttpResponseInfo > handleOptions (soft< data > body, hash< auto > hdr, Socket s, hash< auto > cx)
 Handles a WebDavHandler OPTIONS request.
 
hash< HttpResponseInfo > handleGet (soft< data > body, hash< auto > hdr, Socket s, hash< auto > cx)
 Handles HTTP GET requests for WebDavHandler resources.
 
hash< HttpResponseInfo > handleHead (soft< data > body, hash< auto > hdr, Socket s, hash< auto > cx)
 Handles HTTP HEAD requests for WebDavHandler resources.
 
hash< HttpResponseInfo > handlePost (soft< data > body, hash< auto > hdr, Socket s, hash< auto > cx)
 Handles HTTP POST requests for WebDavHandler resources.
 
hash< HttpResponseInfo > handlePut (soft< data > body, hash< auto > hdr, Socket s, hash< auto > cx)
 Handles HTTP PUT requests for WebDavHandler resources.
 
hash< HttpResponseInfo > handleDelete (soft< data > body, hash< auto > hdr, Socket s, hash< auto > cx)
 Handles HTTP DELETE requests for WebDavHandler resources.
 
hash< HttpResponseInfo > handleCopy (soft< data > body, hash< auto > hdr, Socket s, hash< auto > cx)
 Handles WebDavHandler COPY requests for WebDavHandler resources.
 
hash< HttpResponseInfo > handleMove (soft< data > body, hash< auto > hdr, Socket s, hash< auto > cx)
 Handles WebDavHandler MOVE requests for WebDavHandler resources.
 
hash< HttpResponseInfo > handleLock (soft< data > body, hash< auto > hdr, Socket s, hash< auto > cx)
 Handles WebDavHandler LOCK requests for WebDavHandler resources.
 
hash< HttpResponseInfo > handleUnlock (soft< data > body, hash< auto > hdr, Socket s, hash< auto > cx)
 Handles WebDavHandler UNLOCK requests for WebDavHandler resources.
 
hash< HttpResponseInfo > handleMkcol (soft< data > body, hash< auto > hdr, Socket s, hash< auto > cx)
 Handles WebDavHandler MKCOL requests for WebDavHandler resources.
 
hash< HttpResponseInfo > handlePropfind (soft< data > body, hash< auto > hdr, Socket s, hash< auto > cx)
 Handles WebDavHandler PROPFIND requests for WebDavHandler resources; reetrieves properties from WebDavHandler resources.
 
void logInfo (string fmt)
 This method is called with informational log messages.
 
void logError (string fmt)
 This method is called with error log messages.
 
void logDebug (string fmt)
 This method is called with debug log messages.
 
hash< auto > getXml (string body)
 Parse incoming XML and handle namespaces.
 
hash< HttpResponseInfo > handleOptionsImpl (soft< data > body, hash< auto > hdr, Socket s, hash< auto > cx)
 Handles an HTTP/WebDavHandler OPTIONS request.
 
abstract hash< HttpResponseInfo > handleGetImpl (soft< data > body, hash< auto > hdr, Socket s, hash< auto > cx)
 Handles HTTP GET requests for WebDavHandler resources.
 
abstract hash< HttpResponseInfo > handleHeadImpl (soft< data > body, hash< auto > hdr, Socket s, hash< auto > cx)
 Handles HTTP HEAD requests for WebDavHandler resources.
 
abstract hash< HttpResponseInfo > handlePostImpl (soft< data > body, hash< auto > hdr, Socket s, hash< auto > cx)
 Handles HTTP POST requests for WebDavHandler resources.
 
abstract hash< HttpResponseInfo > handlePutImpl (soft< data > body, hash< auto > hdr, Socket s, hash< auto > cx)
 Handles HTTP PUT requests for WebDavHandler resources.
 
abstract hash< HttpResponseInfo > handleDeleteImpl (soft< data > body, hash< auto > hdr, Socket s, hash< auto > cx)
 Handles HTTP DELETE requests for WebDavHandler resources.
 
abstract hash< HttpResponseInfo > handleCopyImpl (soft< data > body, hash< auto > hdr, Socket s, hash< auto > cx)
 Handles WebDavHandler COPY requests for WebDavHandler resources.
 
abstract hash< HttpResponseInfo > handleMoveImpl (soft< data > body, hash< auto > hdr, Socket s, hash< auto > cx)
 Handles WebDavHandler MOVE requests for WebDavHandler resources.
 
abstract hash< HttpResponseInfo > handleLockImpl (soft< data > body, hash< auto > hdr, Socket s, hash< auto > cx)
 Handles WebDavHandler LOCK requests for WebDavHandler resources.
 
abstract hash< HttpResponseInfo > handleUnlockImpl (soft< data > body, hash< auto > hdr, Socket s, hash< auto > cx)
 Handles WebDavHandler UNLOCK requests for WebDavHandler resources.
 
abstract hash< HttpResponseInfo > handleMkcolImpl (soft< data > body, hash< auto > hdr, Socket s, hash< auto > cx)
 Handles WebDavHandler MKCOL requests for WebDavHandler resources.
 
abstract hash< HttpResponseInfo > handlePropfindImpl (soft< data > body, hash< auto > hdr, Socket s, hash< auto > cx)
 Handles WebDavHandler PROPFIND requests for WebDavHandler resources; reetrieves properties from WebDavHandler resources.
 
abstract soft< hash< string, hash< string, hash< string, bool > > > > handleProppatchImpl (soft< list< hash< PropPatchActionInfo > > > actions, soft< hash< auto > > request_xml, hash< auto > hdr, reference< string > href, hash< auto > cx)
 Internal method for handling PROPPATCH requests.
 
string getNsPrefix (string ns)
 Returns a new namespace prefix.
 

Private Attributes

string basePath
 The root directory for serving files.
 
AbstractWebDavLockHandler lock_handler
 Lock handler for DAV Class 2 locking support.
 
const auto BlockSize = ...
 Default block size for chunked sends (32KiB)
 
const auto IoTimeout = ...
 Default I/O timeout.
 
const auto DefaultLockTimeout = ...
 Default lock timeout in seconds (10 minutes)
 
- Private Attributes inherited from WebDavHandler::AbstractWebDavHandler
AbstractWebDavPropertyHandler property_handler
 The property handler object.
 
string virtual_base_path
 The virtual base path for resources served by the WebDavHandler handler.
 
Logger logger
 The Logger for this object.
 

Additional Inherited Members

- Static Public Member Methods inherited from WebDavHandler::AbstractWebDavHandler
static void combineValue (reference< auto > h, auto v)
 Combines values recursively.
 
- Public Attributes inherited from WebDavHandler::AbstractWebDavHandler
const auto RequestMethods = ...
 A hash of all supported WebDavHandler methods mapped to method names.
 
const auto DestMethods = ...
 A hash of methods that require a Destination header.
 
const auto AllowHeaderValue = ...
 List of WebDavHandler methods in a string suitable for use in HTTP responses.
 
const auto MethodList = ...
 List of WebDavHandler methods.
 
const auto PPA_Remove = ...
 PROPPATCH action: remove.
 
const auto PPA_Set = ...
 PROPPATCH action: set.
 

Detailed Description

Filesystem WebDavHandler inteface class.

Member Function Documentation

◆ constructor() [1/4]

void WebDavHandler::FsWebDavHandler::constructor ( AbstractWebDavPropertyHandler  property_handler,
string  virtual_relative_path_base,
string  path,
soft< HttpServer::AbstractAuthenticator >  auth 
)

Creates the object with the given arguments.

Parameters
paththe path on the local filesystem for WebDAV file handline
auththe authentication object to use to authenticate connections
property_handlerto handle properties
virtual_relative_path_basethe virtual base path for WebDavHandler requests; this path will be stripped from requests internally when serving WebDavHandler resources

◆ constructor() [2/4]

void WebDavHandler::FsWebDavHandler::constructor ( Logger  logger,
AbstractWebDavPropertyHandler  property_handler,
string  path,
soft< HttpServer::AbstractAuthenticator >  auth,
string  virtual_relative_path_base 
)

Creates the object with the given arguments.

Parameters
paththe path on the local filesystem for WebDAV file handline
auththe authentication object to use to authenticate connections
loggerthe logger
property_handlerto handle properties
virtual_relative_path_basethe virtual base path for WebDavHandler requests; this path will be stripped from requests internally when serving WebDavHandler resources

◆ constructor() [3/4]

void WebDavHandler::FsWebDavHandler::constructor ( string  path,
soft< HttpServer::AbstractAuthenticator >  auth 
)

Creates the object with an empty logger and an in-memory property handler.

Parameters
paththe path on the local filesystem for WebDAV file handline
auththe authentication object to use to authenticate connections

◆ constructor() [4/4]

void WebDavHandler::FsWebDavHandler::constructor ( string  virtual_relative_path_base,
string  path,
soft< HttpServer::AbstractAuthenticator >  auth 
)

Creates the object with the given argument and an in-memory property handler.

Parameters
paththe path on the local filesystem for WebDAV file handline
auththe authentication object to use to authenticate connections
virtual_relative_path_basethe virtual base path for WebDavHandler requests; this path will be stripped from requests internally when serving WebDavHandler resources

◆ getRealPath()

string WebDavHandler::FsWebDavHandler::getRealPath ( string  raw_path)

Converts a request path to a normalized real path on the filesystem in the root WebDavHandler directory.

Exceptions
WEBDAVHANDLER-FORBIDDENif the path is not valid

◆ handleCopyImpl()

hash< HttpResponseInfo > WebDavHandler::FsWebDavHandler::handleCopyImpl ( soft< data >  body,
hash< auto >  hdr,
Socket  s,
hash< auto >  cx 
)

Handles WebDavHandler COPY requests for WebDavHandler resources.

Parameters
cxcall context hash; this hash will have the following keys:
  • header-info: a hash of information about the request header with the following keys:
    • accept-charset: this key will be set to an appropriate value from any "Accept-Charset" header; if any of "*", "utf8", or "utf-8" are present, then this will be set to "utf8", otherwise it will be set to the first requested character encoding in the list
    • accept-encoding: a hash where keys are values from any "Accept-Encoding" header and the values are True
    • body-content-type: this is the "Content-Type" header without any charset declaration
    • charset: if there is a charset declaration in the "Content-Type" header, the value is returned in this key
    • client-cert: if the server is configured to capture remote client certificates, and the client supplied a certificate, this key will be populated with the SSLCertificate for the client
    • close: set to True if the connection should be closed after responding, False if not (as derived from the request header)
    • headers-raw: a hash of raw request headers without any case conversions or other processing
    • request-uri: gives the request URI in an HTTP request
  • socket: the bind address used to bind the listener ("socket-info" provides more detailed information)
  • socket-info: a hash of socket information for the listening socket (as returned by Qore::Socket::getSocketInfo)
  • peer-info: a hash of socket information for the remote socket (as returned by Qore::Socket::getPeerInfo)
  • url: a hash of broken-down URL information (as returned from Qore::parse_url)
  • id: the unique HTTP connection ID
  • ssl: True if the request was encrypted with HTTPS, False if not
  • listener-id: the HTTP server listener ID (see HttpServer::getListenerInfo())
  • user: the current RBAC username (if any)
  • root_path: the root URL path matched if the request was matched by a URL prefix
hdrincoming header hash; all keys will be converted to lower-case, additionally the following keys will be present:
  • method: the HTTP method received (ie "GET", "POST", etc)
  • path: the HTTP path given in the request, after processing by Qore::decode_uri_request
  • http_version: the HTTP version number in the request (ex: "1.0", "1.1", or "2.0")
bodymessage body, if any
Returns
the response to the WebDavHandler request

◆ handleDeleteImpl()

hash< HttpResponseInfo > WebDavHandler::FsWebDavHandler::handleDeleteImpl ( soft< data >  body,
hash< auto >  hdr,
Socket  s,
hash< auto >  cx 
)

Handles HTTP DELETE requests for WebDavHandler resources.

Parameters
cxcall context hash; this hash will have the following keys:
  • header-info: a hash of information about the request header with the following keys:
    • accept-charset: this key will be set to an appropriate value from any "Accept-Charset" header; if any of "*", "utf8", or "utf-8" are present, then this will be set to "utf8", otherwise it will be set to the first requested character encoding in the list
    • accept-encoding: a hash where keys are values from any "Accept-Encoding" header and the values are True
    • body-content-type: this is the "Content-Type" header without any charset declaration
    • charset: if there is a charset declaration in the "Content-Type" header, the value is returned in this key
    • client-cert: if the server is configured to capture remote client certificates, and the client supplied a certificate, this key will be populated with the SSLCertificate for the client
    • close: set to True if the connection should be closed after responding, False if not (as derived from the request header)
    • headers-raw: a hash of raw request headers without any case conversions or other processing
    • request-uri: gives the request URI in an HTTP request
  • socket: the bind address used to bind the listener ("socket-info" provides more detailed information)
  • socket-info: a hash of socket information for the listening socket (as returned by Qore::Socket::getSocketInfo)
  • peer-info: a hash of socket information for the remote socket (as returned by Qore::Socket::getPeerInfo)
  • url: a hash of broken-down URL information (as returned from Qore::parse_url)
  • id: the unique HTTP connection ID
  • ssl: True if the request was encrypted with HTTPS, False if not
  • listener-id: the HTTP server listener ID (see HttpServer::getListenerInfo())
  • user: the current RBAC username (if any)
  • root_path: the root URL path matched if the request was matched by a URL prefix
hdrincoming header hash; all keys will be converted to lower-case, additionally the following keys will be present:
  • method: the HTTP method received (ie "GET", "POST", etc)
  • path: the HTTP path given in the request, after processing by Qore::decode_uri_request
  • http_version: the HTTP version number in the request (ex: "1.0", "1.1", or "2.0")
bodymessage body, if any
Returns
the response to the HTTP request

◆ handleGetImpl()

hash< HttpResponseInfo > WebDavHandler::FsWebDavHandler::handleGetImpl ( soft< data >  body,
hash< auto >  hdr,
Socket  s,
hash< auto >  cx 
)

Handles HTTP GET requests for WebDavHandler resources.

Parameters
cxcall context hash; this hash will have the following keys:
  • header-info: a hash of information about the request header with the following keys:
    • accept-charset: this key will be set to an appropriate value from any "Accept-Charset" header; if any of "*", "utf8", or "utf-8" are present, then this will be set to "utf8", otherwise it will be set to the first requested character encoding in the list
    • accept-encoding: a hash where keys are values from any "Accept-Encoding" header and the values are True
    • body-content-type: this is the "Content-Type" header without any charset declaration
    • charset: if there is a charset declaration in the "Content-Type" header, the value is returned in this key
    • client-cert: if the server is configured to capture remote client certificates, and the client supplied a certificate, this key will be populated with the SSLCertificate for the client
    • close: set to True if the connection should be closed after responding, False if not (as derived from the request header)
    • headers-raw: a hash of raw request headers without any case conversions or other processing
    • request-uri: gives the request URI in an HTTP request
  • socket: the bind address used to bind the listener ("socket-info" provides more detailed information)
  • socket-info: a hash of socket information for the listening socket (as returned by Qore::Socket::getSocketInfo)
  • peer-info: a hash of socket information for the remote socket (as returned by Qore::Socket::getPeerInfo)
  • url: a hash of broken-down URL information (as returned from Qore::parse_url)
  • id: the unique HTTP connection ID
  • ssl: True if the request was encrypted with HTTPS, False if not
  • listener-id: the HTTP server listener ID (see HttpServer::getListenerInfo())
  • user: the current RBAC username (if any)
  • root_path: the root URL path matched if the request was matched by a URL prefix
hdrincoming header hash; all keys will be converted to lower-case, additionally the following keys will be present:
  • method: the HTTP method received (ie "GET", "POST", etc)
  • path: the HTTP path given in the request, after processing by Qore::decode_uri_request
  • http_version: the HTTP version number in the request (ex: "1.0", "1.1", or "2.0")
bodymessage body, if any
Returns
the response to the HTTP request

◆ handleHeadImpl()

hash< HttpResponseInfo > WebDavHandler::FsWebDavHandler::handleHeadImpl ( soft< data >  body,
hash< auto >  hdr,
Socket  s,
hash< auto >  cx 
)

Handles HTTP HEAD requests for WebDavHandler resources.

Parameters
cxcall context hash; this hash will have the following keys:
  • header-info: a hash of information about the request header with the following keys:
    • accept-charset: this key will be set to an appropriate value from any "Accept-Charset" header; if any of "*", "utf8", or "utf-8" are present, then this will be set to "utf8", otherwise it will be set to the first requested character encoding in the list
    • accept-encoding: a hash where keys are values from any "Accept-Encoding" header and the values are True
    • body-content-type: this is the "Content-Type" header without any charset declaration
    • charset: if there is a charset declaration in the "Content-Type" header, the value is returned in this key
    • client-cert: if the server is configured to capture remote client certificates, and the client supplied a certificate, this key will be populated with the SSLCertificate for the client
    • close: set to True if the connection should be closed after responding, False if not (as derived from the request header)
    • headers-raw: a hash of raw request headers without any case conversions or other processing
    • request-uri: gives the request URI in an HTTP request
  • socket: the bind address used to bind the listener ("socket-info" provides more detailed information)
  • socket-info: a hash of socket information for the listening socket (as returned by Qore::Socket::getSocketInfo)
  • peer-info: a hash of socket information for the remote socket (as returned by Qore::Socket::getPeerInfo)
  • url: a hash of broken-down URL information (as returned from Qore::parse_url)
  • id: the unique HTTP connection ID
  • ssl: True if the request was encrypted with HTTPS, False if not
  • listener-id: the HTTP server listener ID (see HttpServer::getListenerInfo())
  • user: the current RBAC username (if any)
  • root_path: the root URL path matched if the request was matched by a URL prefix
hdrincoming header hash; all keys will be converted to lower-case, additionally the following keys will be present:
  • method: the HTTP method received (ie "GET", "POST", etc)
  • path: the HTTP path given in the request, after processing by Qore::decode_uri_request
  • http_version: the HTTP version number in the request (ex: "1.0", "1.1", or "2.0")
bodymessage body, if any
Returns
the response to the HTTP request

◆ handleLockImpl()

hash< HttpResponseInfo > WebDavHandler::FsWebDavHandler::handleLockImpl ( soft< data >  body,
hash< auto >  hdr,
Socket  s,
hash< auto >  cx 
)

Handles WebDavHandler LOCK requests for WebDavHandler resources.

Parameters
cxcall context hash; this hash will have the following keys:
  • header-info: a hash of information about the request header with the following keys:
    • accept-charset: this key will be set to an appropriate value from any "Accept-Charset" header; if any of "*", "utf8", or "utf-8" are present, then this will be set to "utf8", otherwise it will be set to the first requested character encoding in the list
    • accept-encoding: a hash where keys are values from any "Accept-Encoding" header and the values are True
    • body-content-type: this is the "Content-Type" header without any charset declaration
    • charset: if there is a charset declaration in the "Content-Type" header, the value is returned in this key
    • client-cert: if the server is configured to capture remote client certificates, and the client supplied a certificate, this key will be populated with the SSLCertificate for the client
    • close: set to True if the connection should be closed after responding, False if not (as derived from the request header)
    • headers-raw: a hash of raw request headers without any case conversions or other processing
    • request-uri: gives the request URI in an HTTP request
  • socket: the bind address used to bind the listener ("socket-info" provides more detailed information)
  • socket-info: a hash of socket information for the listening socket (as returned by Qore::Socket::getSocketInfo)
  • peer-info: a hash of socket information for the remote socket (as returned by Qore::Socket::getPeerInfo)
  • url: a hash of broken-down URL information (as returned from Qore::parse_url)
  • id: the unique HTTP connection ID
  • ssl: True if the request was encrypted with HTTPS, False if not
  • listener-id: the HTTP server listener ID (see HttpServer::getListenerInfo())
  • user: the current RBAC username (if any)
  • root_path: the root URL path matched if the request was matched by a URL prefix
hdrincoming header hash; all keys will be converted to lower-case, additionally the following keys will be present:
  • method: the HTTP method received (ie "GET", "POST", etc)
  • path: the HTTP path given in the request, after processing by Qore::decode_uri_request
  • http_version: the HTTP version number in the request (ex: "1.0", "1.1", or "2.0")
bodymessage body, if any
Returns
the response to the WebDavHandler request

◆ handleMkcolImpl()

hash< HttpResponseInfo > WebDavHandler::FsWebDavHandler::handleMkcolImpl ( soft< data >  body,
hash< auto >  hdr,
Socket  s,
hash< auto >  cx 
)

Handles WebDavHandler MKCOL requests for WebDavHandler resources.

Parameters
cxcall context hash; this hash will have the following keys:
  • header-info: a hash of information about the request header with the following keys:
    • accept-charset: this key will be set to an appropriate value from any "Accept-Charset" header; if any of "*", "utf8", or "utf-8" are present, then this will be set to "utf8", otherwise it will be set to the first requested character encoding in the list
    • accept-encoding: a hash where keys are values from any "Accept-Encoding" header and the values are True
    • body-content-type: this is the "Content-Type" header without any charset declaration
    • charset: if there is a charset declaration in the "Content-Type" header, the value is returned in this key
    • client-cert: if the server is configured to capture remote client certificates, and the client supplied a certificate, this key will be populated with the SSLCertificate for the client
    • close: set to True if the connection should be closed after responding, False if not (as derived from the request header)
    • headers-raw: a hash of raw request headers without any case conversions or other processing
    • request-uri: gives the request URI in an HTTP request
  • socket: the bind address used to bind the listener ("socket-info" provides more detailed information)
  • socket-info: a hash of socket information for the listening socket (as returned by Qore::Socket::getSocketInfo)
  • peer-info: a hash of socket information for the remote socket (as returned by Qore::Socket::getPeerInfo)
  • url: a hash of broken-down URL information (as returned from Qore::parse_url)
  • id: the unique HTTP connection ID
  • ssl: True if the request was encrypted with HTTPS, False if not
  • listener-id: the HTTP server listener ID (see HttpServer::getListenerInfo())
  • user: the current RBAC username (if any)
  • root_path: the root URL path matched if the request was matched by a URL prefix
hdrincoming header hash; all keys will be converted to lower-case, additionally the following keys will be present:
  • method: the HTTP method received (ie "GET", "POST", etc)
  • path: the HTTP path given in the request, after processing by Qore::decode_uri_request
  • http_version: the HTTP version number in the request (ex: "1.0", "1.1", or "2.0")
bodymessage body, if any
Returns
the response to the WebDavHandler request

◆ handleMoveImpl()

hash< HttpResponseInfo > WebDavHandler::FsWebDavHandler::handleMoveImpl ( soft< data >  body,
hash< auto >  hdr,
Socket  s,
hash< auto >  cx 
)

Handles WebDavHandler MOVE requests for WebDavHandler resources.

Parameters
cxcall context hash; this hash will have the following keys:
  • header-info: a hash of information about the request header with the following keys:
    • accept-charset: this key will be set to an appropriate value from any "Accept-Charset" header; if any of "*", "utf8", or "utf-8" are present, then this will be set to "utf8", otherwise it will be set to the first requested character encoding in the list
    • accept-encoding: a hash where keys are values from any "Accept-Encoding" header and the values are True
    • body-content-type: this is the "Content-Type" header without any charset declaration
    • charset: if there is a charset declaration in the "Content-Type" header, the value is returned in this key
    • client-cert: if the server is configured to capture remote client certificates, and the client supplied a certificate, this key will be populated with the SSLCertificate for the client
    • close: set to True if the connection should be closed after responding, False if not (as derived from the request header)
    • headers-raw: a hash of raw request headers without any case conversions or other processing
    • request-uri: gives the request URI in an HTTP request
  • socket: the bind address used to bind the listener ("socket-info" provides more detailed information)
  • socket-info: a hash of socket information for the listening socket (as returned by Qore::Socket::getSocketInfo)
  • peer-info: a hash of socket information for the remote socket (as returned by Qore::Socket::getPeerInfo)
  • url: a hash of broken-down URL information (as returned from Qore::parse_url)
  • id: the unique HTTP connection ID
  • ssl: True if the request was encrypted with HTTPS, False if not
  • listener-id: the HTTP server listener ID (see HttpServer::getListenerInfo())
  • user: the current RBAC username (if any)
  • root_path: the root URL path matched if the request was matched by a URL prefix
hdrincoming header hash; all keys will be converted to lower-case, additionally the following keys will be present:
  • method: the HTTP method received (ie "GET", "POST", etc)
  • path: the HTTP path given in the request, after processing by Qore::decode_uri_request
  • http_version: the HTTP version number in the request (ex: "1.0", "1.1", or "2.0")
bodymessage body, if any
Returns
the response to the WebDavHandler request

◆ handlePostImpl()

hash< HttpResponseInfo > WebDavHandler::FsWebDavHandler::handlePostImpl ( soft< data >  body,
hash< auto >  hdr,
Socket  s,
hash< auto >  cx 
)

Handles HTTP POST requests for WebDavHandler resources.

Parameters
cxcall context hash; this hash will have the following keys:
  • header-info: a hash of information about the request header with the following keys:
    • accept-charset: this key will be set to an appropriate value from any "Accept-Charset" header; if any of "*", "utf8", or "utf-8" are present, then this will be set to "utf8", otherwise it will be set to the first requested character encoding in the list
    • accept-encoding: a hash where keys are values from any "Accept-Encoding" header and the values are True
    • body-content-type: this is the "Content-Type" header without any charset declaration
    • charset: if there is a charset declaration in the "Content-Type" header, the value is returned in this key
    • client-cert: if the server is configured to capture remote client certificates, and the client supplied a certificate, this key will be populated with the SSLCertificate for the client
    • close: set to True if the connection should be closed after responding, False if not (as derived from the request header)
    • headers-raw: a hash of raw request headers without any case conversions or other processing
    • request-uri: gives the request URI in an HTTP request
  • socket: the bind address used to bind the listener ("socket-info" provides more detailed information)
  • socket-info: a hash of socket information for the listening socket (as returned by Qore::Socket::getSocketInfo)
  • peer-info: a hash of socket information for the remote socket (as returned by Qore::Socket::getPeerInfo)
  • url: a hash of broken-down URL information (as returned from Qore::parse_url)
  • id: the unique HTTP connection ID
  • ssl: True if the request was encrypted with HTTPS, False if not
  • listener-id: the HTTP server listener ID (see HttpServer::getListenerInfo())
  • user: the current RBAC username (if any)
  • root_path: the root URL path matched if the request was matched by a URL prefix
hdrincoming header hash; all keys will be converted to lower-case, additionally the following keys will be present:
  • method: the HTTP method received (ie "GET", "POST", etc)
  • path: the HTTP path given in the request, after processing by Qore::decode_uri_request
  • http_version: the HTTP version number in the request (ex: "1.0", "1.1", or "2.0")
bodymessage body, if any
Returns
the response to the HTTP request

◆ handlePropfindImpl()

hash< HttpResponseInfo > WebDavHandler::FsWebDavHandler::handlePropfindImpl ( soft< data >  body,
hash< auto >  hdr,
Socket  s,
hash< auto >  cx 
)

Handles WebDavHandler PROPFIND requests for WebDavHandler resources; reetrieves properties from WebDavHandler resources.

Parameters
cxcall context hash; this hash will have the following keys:
  • header-info: a hash of information about the request header with the following keys:
    • accept-charset: this key will be set to an appropriate value from any "Accept-Charset" header; if any of "*", "utf8", or "utf-8" are present, then this will be set to "utf8", otherwise it will be set to the first requested character encoding in the list
    • accept-encoding: a hash where keys are values from any "Accept-Encoding" header and the values are True
    • body-content-type: this is the "Content-Type" header without any charset declaration
    • charset: if there is a charset declaration in the "Content-Type" header, the value is returned in this key
    • client-cert: if the server is configured to capture remote client certificates, and the client supplied a certificate, this key will be populated with the SSLCertificate for the client
    • close: set to True if the connection should be closed after responding, False if not (as derived from the request header)
    • headers-raw: a hash of raw request headers without any case conversions or other processing
    • request-uri: gives the request URI in an HTTP request
  • socket: the bind address used to bind the listener ("socket-info" provides more detailed information)
  • socket-info: a hash of socket information for the listening socket (as returned by Qore::Socket::getSocketInfo)
  • peer-info: a hash of socket information for the remote socket (as returned by Qore::Socket::getPeerInfo)
  • url: a hash of broken-down URL information (as returned from Qore::parse_url)
  • id: the unique HTTP connection ID
  • ssl: True if the request was encrypted with HTTPS, False if not
  • listener-id: the HTTP server listener ID (see HttpServer::getListenerInfo())
  • user: the current RBAC username (if any)
  • root_path: the root URL path matched if the request was matched by a URL prefix
hdrincoming header hash; all keys will be converted to lower-case, additionally the following keys will be present:
  • method: the HTTP method received (ie "GET", "POST", etc)
  • path: the HTTP path given in the request, after processing by Qore::decode_uri_request
  • http_version: the HTTP version number in the request (ex: "1.0", "1.1", or "2.0")
bodymessage body, if any
Returns
the response to the WebDavHandler request

◆ handleProppatchImpl()

soft< hash< string, hash< string, hash< string, bool > > > > WebDavHandler::FsWebDavHandler::handleProppatchImpl ( soft< list< hash< PropPatchActionInfo > > >  actions,
soft< hash< auto > >  request_xml,
hash< auto >  hdr,
reference< string >  href,
hash< auto >  cx 
)

Internal method for handling PROPPATCH requests.

Create, change and delete one or more properties on a resource in a single atomic action

Parameters
cxthe HTTP call context
hdras hash HTTP headers
request_xmlthe parsed XML in the request
actionsa list of set and remove actions to execute on the given properties
Returns
a status map of HTTP code -> namespace -> property -> True
Exceptions
WEBDAVHANDLER-ERRORan error occured

◆ handlePutImpl()

hash< HttpResponseInfo > WebDavHandler::FsWebDavHandler::handlePutImpl ( soft< data >  body,
hash< auto >  hdr,
Socket  s,
hash< auto >  cx 
)

Handles HTTP PUT requests for WebDavHandler resources.

Parameters
cxcall context hash; this hash will have the following keys:
  • header-info: a hash of information about the request header with the following keys:
    • accept-charset: this key will be set to an appropriate value from any "Accept-Charset" header; if any of "*", "utf8", or "utf-8" are present, then this will be set to "utf8", otherwise it will be set to the first requested character encoding in the list
    • accept-encoding: a hash where keys are values from any "Accept-Encoding" header and the values are True
    • body-content-type: this is the "Content-Type" header without any charset declaration
    • charset: if there is a charset declaration in the "Content-Type" header, the value is returned in this key
    • client-cert: if the server is configured to capture remote client certificates, and the client supplied a certificate, this key will be populated with the SSLCertificate for the client
    • close: set to True if the connection should be closed after responding, False if not (as derived from the request header)
    • headers-raw: a hash of raw request headers without any case conversions or other processing
    • request-uri: gives the request URI in an HTTP request
  • socket: the bind address used to bind the listener ("socket-info" provides more detailed information)
  • socket-info: a hash of socket information for the listening socket (as returned by Qore::Socket::getSocketInfo)
  • peer-info: a hash of socket information for the remote socket (as returned by Qore::Socket::getPeerInfo)
  • url: a hash of broken-down URL information (as returned from Qore::parse_url)
  • id: the unique HTTP connection ID
  • ssl: True if the request was encrypted with HTTPS, False if not
  • listener-id: the HTTP server listener ID (see HttpServer::getListenerInfo())
  • user: the current RBAC username (if any)
  • root_path: the root URL path matched if the request was matched by a URL prefix
hdrincoming header hash; all keys will be converted to lower-case, additionally the following keys will be present:
  • method: the HTTP method received (ie "GET", "POST", etc)
  • path: the HTTP path given in the request, after processing by Qore::decode_uri_request
  • http_version: the HTTP version number in the request (ex: "1.0", "1.1", or "2.0")
bodymessage body, if any
Returns
the response to the HTTP request

◆ handleUnlockImpl()

hash< HttpResponseInfo > WebDavHandler::FsWebDavHandler::handleUnlockImpl ( soft< data >  body,
hash< auto >  hdr,
Socket  s,
hash< auto >  cx 
)

Handles WebDavHandler UNLOCK requests for WebDavHandler resources.

Parameters
cxcall context hash; this hash will have the following keys:
  • header-info: a hash of information about the request header with the following keys:
    • accept-charset: this key will be set to an appropriate value from any "Accept-Charset" header; if any of "*", "utf8", or "utf-8" are present, then this will be set to "utf8", otherwise it will be set to the first requested character encoding in the list
    • accept-encoding: a hash where keys are values from any "Accept-Encoding" header and the values are True
    • body-content-type: this is the "Content-Type" header without any charset declaration
    • charset: if there is a charset declaration in the "Content-Type" header, the value is returned in this key
    • client-cert: if the server is configured to capture remote client certificates, and the client supplied a certificate, this key will be populated with the SSLCertificate for the client
    • close: set to True if the connection should be closed after responding, False if not (as derived from the request header)
    • headers-raw: a hash of raw request headers without any case conversions or other processing
    • request-uri: gives the request URI in an HTTP request
  • socket: the bind address used to bind the listener ("socket-info" provides more detailed information)
  • socket-info: a hash of socket information for the listening socket (as returned by Qore::Socket::getSocketInfo)
  • peer-info: a hash of socket information for the remote socket (as returned by Qore::Socket::getPeerInfo)
  • url: a hash of broken-down URL information (as returned from Qore::parse_url)
  • id: the unique HTTP connection ID
  • ssl: True if the request was encrypted with HTTPS, False if not
  • listener-id: the HTTP server listener ID (see HttpServer::getListenerInfo())
  • user: the current RBAC username (if any)
  • root_path: the root URL path matched if the request was matched by a URL prefix
hdrincoming header hash; all keys will be converted to lower-case, additionally the following keys will be present:
  • method: the HTTP method received (ie "GET", "POST", etc)
  • path: the HTTP path given in the request, after processing by Qore::decode_uri_request
  • http_version: the HTTP version number in the request (ex: "1.0", "1.1", or "2.0")
bodymessage body, if any
Returns
the response to the WebDavHandler request

◆ parseTimeout()

int WebDavHandler::FsWebDavHandler::parseTimeout ( soft< string >  timeout_header)

Parses the Timeout header value.

Parameters
timeout_headerthe Timeout header value (e.g., "Second-3600", "Infinite")
Returns
timeout in seconds, or 0 for infinite

The documentation for this class was generated from the following file: