WebDAV client class.
More...
#include <WebDavClient.qm.dox.h>
Inherits Qore::HTTPClient.
|
| void | constructor (hash< auto > opts) |
| | Creates a WebDavClient object.
|
| |
|
void | setDebug (bool val) |
| | Enables or disables debug output.
|
| |
| list< string > | options (string path) |
| | Gets the supported DAV capabilities.
|
| |
| list< hash< WebDavResourceInfo > > | list (string path, string depth) |
| | Lists resources in a directory using PROPFIND.
|
| |
| soft< data > | get (string path) |
| | Downloads a file.
|
| |
| bool | put (soft< string > content_type, string path, data content) |
| | Uploads a file.
|
| |
| void | del (string path) |
| | Deletes a resource.
|
| |
| void | mkcol (string path) |
| | Creates a collection (directory)
|
| |
| void | copyResource (string src, string dest, bool overwrite) |
| | Copies a resource.
|
| |
| void | moveResource (string src, string dest, bool overwrite) |
| | Moves a resource.
|
| |
| void | unlock (string path, string token) |
| | Unlocks a resource.
|
| |
| bool | exists (string path) |
| | Checks if a resource exists.
|
| |
|
string | resolvePath (string path) |
| | Resolves a path relative to the base path.
|
| |
|
list< hash< WebDavResourceInfo > > | parsePropfindResponse (auto body) |
| | Parses a PROPFIND response.
|
| |
|
hash< WebDavResourceInfo > | parseResourceResponse (hash< auto > resp) |
| | Parses a single response element.
|
| |
|
soft< date > | parseDate (soft< string > str) |
| | Parses a date string.
|
| |
|
|
static hash< auto > | getClientOpts (hash< auto > opts) |
| | Returns HTTPClient options from constructor options.
|
| |
|
|
const auto | DefaultTimeout = ... |
| | Default timeout for operations (30 seconds)
|
| |
WebDAV client class.
This class provides a WebDAV client implementation based on HTTPClient.
◆ constructor()
| void WebDavClient::WebDavClient::constructor |
( |
hash< auto > |
opts | ) |
|
Creates a WebDavClient object.
- Parameters
-
| opts | a hash of options:
url: (required) the WebDAV server URL
timeout: (optional) connection/I/O timeout in milliseconds (default: 30000)
connect_timeout: (optional) connection timeout in milliseconds
proxy: (optional) proxy URL
ssl_cert_path: (optional) path to SSL client certificate
ssl_key_path: (optional) path to SSL client private key
ssl_key_password: (optional) password for SSL private key
ssl_verify_cert: (optional) verify server certificate (default: True)
|
◆ copyResource()
| void WebDavClient::WebDavClient::copyResource |
( |
string |
src, |
|
|
string |
dest, |
|
|
bool |
overwrite |
|
) |
| |
Copies a resource.
- Parameters
-
| src | source path |
| dest | destination path |
| overwrite | whether to overwrite existing resources (default: True) |
◆ del()
| void WebDavClient::WebDavClient::del |
( |
string |
path | ) |
|
Deletes a resource.
- Parameters
-
◆ exists()
| bool WebDavClient::WebDavClient::exists |
( |
string |
path | ) |
|
Checks if a resource exists.
- Parameters
-
- Returns
- True if the resource exists, False otherwise
◆ get()
| soft< data > WebDavClient::WebDavClient::get |
( |
string |
path | ) |
|
Downloads a file.
- Parameters
-
- Returns
- the file contents as binary data, or NOTHING if not found
◆ list()
| list< hash< WebDavResourceInfo > > WebDavClient::WebDavClient::list |
( |
string |
path, |
|
|
string |
depth |
|
) |
| |
Lists resources in a directory using PROPFIND.
- Parameters
-
| path | the path to list |
| depth | "0" for just the resource, "1" for immediate children, "infinity" for all descendants |
- Returns
- a list of resource information
◆ mkcol()
| void WebDavClient::WebDavClient::mkcol |
( |
string |
path | ) |
|
Creates a collection (directory)
- Parameters
-
◆ moveResource()
| void WebDavClient::WebDavClient::moveResource |
( |
string |
src, |
|
|
string |
dest, |
|
|
bool |
overwrite |
|
) |
| |
Moves a resource.
- Parameters
-
| src | source path |
| dest | destination path |
| overwrite | whether to overwrite existing resources (default: True) |
◆ options()
| list< string > WebDavClient::WebDavClient::options |
( |
string |
path | ) |
|
Gets the supported DAV capabilities.
- Returns
- a list of DAV compliance classes (e.g., "1", "2", "3")
◆ put()
| bool WebDavClient::WebDavClient::put |
( |
soft< string > |
content_type, |
|
|
string |
path, |
|
|
data |
content |
|
) |
| |
Uploads a file.
- Parameters
-
| path | the file path |
| content | the file contents |
| content_type | optional content type (default: application/octet-stream) |
- Returns
- True if a new resource was created, False if an existing resource was updated
◆ unlock()
| void WebDavClient::WebDavClient::unlock |
( |
string |
path, |
|
|
string |
token |
|
) |
| |
Unlocks a resource.
- Parameters
-
| path | the resource path |
| token | the lock token |
The documentation for this class was generated from the following file:
- doxygen/qlib/WebDavClient/WebDavClient.qm.dox.h