EDataServer.WebDAVSession

g EDataServer.SoupSession EDataServer.SoupSession EDataServer.WebDAVSession EDataServer.WebDAVSession EDataServer.SoupSession->EDataServer.WebDAVSession GObject.Object GObject.Object Soup.Session Soup.Session GObject.Object->Soup.Session Soup.Session->EDataServer.SoupSession

Subclasses:

None

Methods

Inherited:

EDataServer.SoupSession (27), Soup.Session (43), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (source)

class

util_free_privileges (privileges)

class

util_item_href_equal (href1, href2)

acl_sync (uri, xml, cancellable)

copy_sync (source_uri, destination_uri, depth, can_overwrite, cancellable)

delete_sync (uri, depth, etag, cancellable)

delete_with_headers_sync (uri, depth, etag, in_headers, cancellable)

ensure_full_uri (request_uri, href)

get_acl_restrictions_sync (uri, cancellable)

get_acl_sync (uri, cancellable)

get_current_user_privilege_set_full_sync (uri, cancellable)

get_current_user_privilege_set_sync (uri, cancellable)

get_data_sync (uri, cancellable)

get_last_dav_error_code ()

get_last_dav_error_is_permission ()

get_principal_collection_set_sync (uri, cancellable)

get_supported_privilege_set_sync (uri, cancellable)

get_sync (uri, cancellable)

getctag_sync (uri, cancellable)

list_sync (uri, depth, flags, cancellable)

lock_resource_sync (uri, lock_scope, lock_timeout, owner, cancellable)

lock_sync (uri, depth, lock_timeout, xml, cancellable)

mkcalendar_sync (uri, display_name, description, color, supports, cancellable)

mkcol_addressbook_sync (uri, display_name, description, cancellable)

mkcol_sync (uri, cancellable)

move_sync (source_uri, destination_uri, can_overwrite, cancellable)

new_message (method, uri)

options_sync (uri, cancellable)

post_sync (uri, data, data_length, in_content_type, in_headers, cancellable)

principal_property_search_sync (uri, apply_to_principal_collection_set, match_ns_uri, match_property, match_value, cancellable)

propfind_sync (uri, depth, xml, func, func_user_data, cancellable)

proppatch_sync (uri, xml, cancellable)

put_data_sync (uri, etag, content_type, in_headers, bytes, length, cancellable)

put_sync (uri, etag, content_type, in_headers, stream, stream_length, cancellable)

refresh_lock_sync (uri, lock_token, lock_timeout, cancellable)

replace_with_detailed_error (message, response_data, ignore_multistatus, prefix)

report_sync (uri, depth, xml, func, func_user_data, out_content_type, out_content, cancellable)

set_acl_sync (uri, entries, cancellable)

traverse_mkcalendar_response (message, xml_data, func, *func_user_data)

traverse_mkcol_response (message, xml_data, func, *func_user_data)

traverse_multistatus_response (message, xml_data, func, *func_user_data)

unlock_sync (uri, lock_token, cancellable)

update_properties_sync (uri, changes, cancellable)

Virtual Methods

Inherited:

Soup.Session (2), GObject.Object (7)

Properties

Inherited:

EDataServer.SoupSession (3), Soup.Session (12)

Signals

Inherited:

Soup.Session (2), GObject.Object (1)

Fields

Inherited:

Soup.Session (2), GObject.Object (1)

Name

Type

Access

Description

parent

EDataServer.SoupSession

r

Class Details

class EDataServer.WebDAVSession(**kwargs)
Bases:

EDataServer.SoupSession

Abstract:

No

Structure:

EDataServer.WebDAVSessionClass

Contains only private data that should be read and manipulated using the functions below.

New in version 3.26.

classmethod new(source)
Parameters:

source (EDataServer.Source) – an EDataServer.Source

Returns:

a new EDataServer.WebDAVSession; free it with GObject.Object.unref(), when no longer needed.

Return type:

EDataServer.WebDAVSession

Creates a new EDataServer.WebDAVSession associated with given source. The EDataServer.WebDAVSession uses an EDataServer.SourceWebdav extension on certain places when it’s defined for the source.

New in version 3.26.

classmethod util_free_privileges(privileges)
Parameters:

privileges (GLib.Node or None) – a tree of EDataServer.WebDAVPrivilege structures

Frees privileges returned by EDataServer.WebDAVSession.get_supported_privilege_set_sync(). The function does nothing, if privileges is None.

New in version 3.26.

classmethod util_item_href_equal(href1, href2)
Parameters:
  • href1 (str) – the first href

  • href2 (str) – the second href

Returns:

whether the two href-s reference the same item

Return type:

bool

Compares two hrefs and return whether they reference the same item on the server. The comparison is done in a relaxed way, not considering scheme Camel.part and comparing the host name case insensitively, while the path case sensitively. It also ignores the username/password information in the hostname Camel.part, if it’s included. The function doesn’t decode any URI-encoded characters.

New in version 3.40.

acl_sync(uri, xml, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

Whether succeeded.

Return type:

bool

Issues ACL request on the provided uri, or, in case it’s None, on the URI defined in associated EDataServer.Source.

New in version 3.26.

copy_sync(source_uri, destination_uri, depth, can_overwrite, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

Whether succeeded.

Return type:

bool

Copies a resource identified by source_uri to destination_uri on the server. The source_uri can reference also collections, in which case the depth influences whether only the collection itself is copied (EDataServer.WEBDAV_DEPTH_THIS) or whether the collection with all its children is copied (EDataServer.WEBDAV_DEPTH_INFINITY).

New in version 3.26.

delete_sync(uri, depth, etag, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

Whether succeeded.

Return type:

bool

Deletes a resource identified by uri on the server. The URI can reference a collection, in which case depth should be EDataServer.WEBDAV_DEPTH_INFINITY. Use depth EDataServer.WEBDAV_DEPTH_THIS when deleting a regular resource, or None, to let the server use default Depth.

The etag argument is used to avoid clashes when overwriting existing resources. Use None etag when deleting collection resources or to force the deletion, otherwise provide a valid ETag of a non-collection resource to verify that the version requested to delete is the same as on the server.

Note that the actual usage of etag is also influenced by EDataServer.SourceWebdav :avoid-ifmatch property of the associated EDataServer.Source.

New in version 3.26.

delete_with_headers_sync(uri, depth, etag, in_headers, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

Whether succeeded.

Return type:

bool

Deletes a resource identified by uri on the server. The URI can reference a collection, in which case depth should be EDataServer.WEBDAV_DEPTH_INFINITY. Use depth EDataServer.WEBDAV_DEPTH_THIS when deleting a regular resource, or None, to let the server use default Depth.

The etag argument is used to avoid clashes when overwriting existing resources. Use None etag when deleting collection resources or to force the deletion, otherwise provide a valid ETag of a non-collection resource to verify that the version requested to delete is the same as on the server.

The optional in_headers can contain additional headers to be added to the request. These headers replace any existing in the request headers, without support for the list-values headers.

Note that the actual usage of etag is also influenced by EDataServer.SourceWebdav :avoid-ifmatch property of the associated EDataServer.Source.

New in version 3.50.

ensure_full_uri(request_uri, href)
Parameters:
Returns:

The href as a full URI

Return type:

str

Converts possibly path-only href into a full URI under the request_uri. When the request_uri is None, the URI defined in associated EDataServer.Source is used instead, taken from the EDataServer.SourceWebdav extension, if defined.

Free the returned pointer with GLib.free(), when no longer needed.

New in version 3.24.

get_acl_restrictions_sync(uri, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

Whether succeeded.

out_restrictions:

return location for bit-or of EDataServer.WebDAVACLRestrictions

out_principal_kind:

return location for principal kind

out_principal_hrefs:

return location for a GLib.SList of principal href-s

Return type:

(bool, out_restrictions: int, out_principal_kind: EDataServer.WebDAVACEPrincipalKind, out_principal_hrefs: [str])

Gets Access Control List (ACL) restrictions for the uri, or, in case it’s None, for the URI defined in associated EDataServer.Source. The out_principal_kind is valid only if the out_restrictions contains EDataServer.WebDAVACLRestrictions.REQUIRED_PRINCIPAL. The out_principal_hrefs is valid only if the out_principal_kind is valid and when it is EDataServer.WebDAVACEPrincipalKind.HREF.

Free the returned out_principal_hrefs with g_slist_free_full (entries, GLib.free); when no longer needed.

New in version 3.26.

get_acl_sync(uri, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

Whether succeeded.

out_entries:

return location for a GLib.SList of EDataServer.WebDAVAccessControlEntry

Return type:

(bool, out_entries: [EDataServer.WebDAVAccessControlEntry])

Gets Access Control List (ACL) for the uri, or, in case it’s None, for the URI defined in associated EDataServer.Source.

This function doesn’t read general EDataServer.WebDAVACEPrincipalKind.PROPERTY.

Free the returned out_entries with g_slist_free_full (entries, EDataServer.WebDAVAccessControlEntry.free); when no longer needed.

New in version 3.26.

get_current_user_privilege_set_full_sync(uri, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

Whether succeeded.

out_privileges:

return location for a GLib.SList of EDataServer.WebDAVPrivilege

out_capabilities:

return location for DAV capabilities, or None

out_allows:

return location for allowed operations, or None

Return type:

(bool, out_privileges: [EDataServer.WebDAVPrivilege], out_capabilities: {object: object}, out_allows: {object: object})

Gets current user privileges for the uri, or, in case it’s None, for the URI defined in associated EDataServer.Source, with optional read of the capabilities and what the user is allowed. See EDataServer.WebDAVSession.options_sync() for more information about the out_capabilities and out_allows values.

Free the returned out_privileges with g_slist_free_full (privileges, EDataServer.WebDAVPrivilege.free); when no longer needed.

New in version 3.26.

get_current_user_privilege_set_sync(uri, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

Whether succeeded.

out_privileges:

return location for a GLib.SList of EDataServer.WebDAVPrivilege

Return type:

(bool, out_privileges: [EDataServer.WebDAVPrivilege])

Gets current user privileges for the uri, or, in case it’s None, for the URI defined in associated EDataServer.Source.

Free the returned out_privileges with g_slist_free_full (privileges, EDataServer.WebDAVPrivilege.free); when no longer needed.

New in version 3.26.

get_data_sync(uri, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

Whether succeeded.

out_href:

optional return location for href of the resource, or None

out_etag:

optional return location for etag of the resource, or None

out_headers:

optional return location for response Soup.MessageHeaders, or None

out_bytes:

return location for bytes being read

out_length:

option return location for length of bytes being read, or None

Return type:

(bool, out_href: str or None, out_etag: str or None, out_headers: Soup.MessageHeaders, out_bytes: str, out_length: int)

Reads a resource identified by uri from the server. The URI cannot reference a collection.

The out_bytes is filled by actual data being read. If not None, out_length is populated with how many bytes had been read. The out_bytes is always NUL-terminated, while this termination byte is not Camel.part of out_length. Free the out_bytes with GLib.free(), when no longer needed.

Free returned pointer of out_href and out_etag, if not None, with GLib.free(), when no longer needed.

The optional out_headers contains response headers. Free it with soup_message_headers_free(), when no longer needed.

To read large data use EDataServer.WebDAVSession.get_sync() instead.

New in version 3.26.

get_last_dav_error_code()
Returns:

a DAV error from the last request, or None, when no error had been recognized.

Return type:

str or None

Returns last DAV error code as returned by the server. Each recognized code is enclosed in “[]” in the returned string, to be able to distinguish between them, in case the server returned multiple codes.

The string is valid until the next request is executed.

New in version 3.36.

get_last_dav_error_is_permission()
Returns:

whether the last recognized DAV error code contains an error which means that user doesn’t have permission for the operation. If there is no DAV error stored, then returns False.

Return type:

bool

New in version 3.36.

get_principal_collection_set_sync(uri, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

Whether succeeded.

out_principal_hrefs:

return location for a GLib.SList of principal href-s

Return type:

(bool, out_principal_hrefs: [str])

Gets list of principal collection href for the uri, or, in case it’s None, for the URI defined in associated EDataServer.Source. The out_principal_hrefs are root collections that contain the principals that are available on the server that implements this resource.

Free the returned out_principal_hrefs with g_slist_free_full (entries, GLib.free); when no longer needed.

New in version 3.26.

get_supported_privilege_set_sync(uri, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

Whether succeeded.

out_privileges:

return location for the tree of supported privileges

Return type:

(bool, out_privileges: GLib.Node)

Gets supported privileges for the uri, or, in case it’s None, for the URI defined in associated EDataServer.Source.

The root node of out_privileges has always None data.

Free the returned out_privileges with EDataServer.WebDAVSession.util_free_privileges() when no longer needed.

New in version 3.26.

get_sync(uri, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

Whether succeeded.

out_href:

optional return location for href of the resource, or None

out_etag:

optional return location for etag of the resource, or None

out_headers:

optional return location for response Soup.MessageHeaders, or None

out_stream:

a Gio.OutputStream to write data to

Return type:

(bool, out_href: str or None, out_etag: str or None, out_headers: Soup.MessageHeaders, out_stream: Gio.OutputStream)

Reads a resource identified by uri from the server and writes it to the stream. The URI cannot reference a collection.

Free returned pointer of out_href and out_etag, if not None, with GLib.free(), when no longer needed.

The optional out_headers contains response headers. Free it with soup_message_headers_free(), when no longer needed.

The EDataServer.WebDAVSession.get_data_sync() can be used to read the resource data directly to memory.

New in version 3.26.

getctag_sync(uri, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

Whether succeeded.

out_ctag:

return location for the ctag

Return type:

(bool, out_ctag: str)

Issues a getctag property request for a collection identified by uri, or, in case it’s None, on the URI defined in associated EDataServer.Source. The ctag is a collection tag, which changes whenever the collection changes (similar to etag). The getctag is an extension, thus the function can fail when the server doesn’t support it.

Free the returned out_ctag with GLib.free(), when no longer needed.

New in version 3.26.

list_sync(uri, depth, flags, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

Whether succeeded.

out_resources:

return location for the resources

Return type:

(bool, out_resources: [EDataServer.WebDAVResource])

Lists content of the uri, or, in case it’s None, of the URI defined in associated EDataServer.Source, which should point to a collection. The flags influences which properties are read for the resources.

The out_resources is in no particular order.

Free the returned out_resources with g_slist_free_full (resources, EDataServer.WebDAVResource.free); when no longer needed.

New in version 3.26.

lock_resource_sync(uri, lock_scope, lock_timeout, owner, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

Whether succeeded.

out_lock_token:

return location of the obtained or refreshed lock token

Return type:

(bool, out_lock_token: str)

Locks a resource identified by uri, or, in case it’s None, by the URI defined in associated EDataServer.Source. It obtains a write lock with the given lock_scope.

The owner is used to identify the lock owner. When it’s an http:// or https://, then it’s referenced as DAV:href, otherwise the value is treated as plain text. If it’s None, then the user name from the associated EDataServer.Source is used.

The out_lock_token can be refreshed with EDataServer.WebDAVSession.refresh_lock_sync(). Release the lock with EDataServer.WebDAVSession.unlock_sync(). Free the returned out_lock_token with GLib.free(), when no longer needed.

New in version 3.26.

lock_sync(uri, depth, lock_timeout, xml, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

Whether succeeded.

out_lock_token:

return location of the obtained or refreshed lock token

out_xml_response:

optional return location for the server response as libxml2.DocPtr

Return type:

(bool, out_lock_token: str, out_xml_response: libxml2.Doc or None)

Locks a resource identified by uri, or, in case it’s None, on the URI defined in associated EDataServer.Source.

The out_lock_token can be refreshed with EDataServer.WebDAVSession.refresh_lock_sync(). Release the lock with EDataServer.WebDAVSession.unlock_sync(). Free the returned out_lock_token with GLib.free(), when no longer needed.

If provided, free the returned out_xml_response with xmlFreeDoc(), when no longer needed.

New in version 3.26.

mkcalendar_sync(uri, display_name, description, color, supports, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

Whether succeeded.

Return type:

bool

Creates a new calendar collection identified by uri on the server. The supports defines what component types can be stored into the created calendar collection. Only EDataServer.WebDAVResourceSupports.NONE and values related to iCalendar content can be used here. Using EDataServer.WebDAVResourceSupports.NONE means that everything is supported.

Note that CalDAV RFC 4791 Section 4.2 forbids to create calendar resources under other calendar resources (no nested calendars are allowed).

New in version 3.26.

mkcol_addressbook_sync(uri, display_name, description, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

Whether succeeded.

Return type:

bool

Creates a new address book collection identified by uri on the server.

Note that CardDAV RFC 6352 Section 5.2 forbids to create address book resources under other address book resources (no nested address books are allowed).

New in version 3.26.

mkcol_sync(uri, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

Whether succeeded.

Return type:

bool

Creates a new generic collection identified by uri on the server. To create specific collections use EDataServer.WebDAVSession.mkcalendar_sync() or EDataServer.WebDAVSession.mkcol_addressbook_sync().

New in version 3.26.

move_sync(source_uri, destination_uri, can_overwrite, cancellable)
Parameters:
  • source_uri (str) – URI of the resource or collection to copy

  • destination_uri (str) – URI of the destination

  • can_overwrite (bool) – whether can overwrite destination_uri, when it exists

  • cancellable (Gio.Cancellable or None) – optional Gio.Cancellable object, or None

Raises:

GLib.Error

Returns:

Whether succeeded.

Return type:

bool

Moves a resource identified by source_uri to destination_uri on the server. The source_uri can reference also collections.

New in version 3.26.

new_message(method, uri)
Parameters:
Raises:

GLib.Error

Returns:

A new Soup.Message for the given uri, or, when None, for the URI stored in the associated EDataServer.Source. Free the returned structure with GObject.Object.unref(), when no longer needed.

Return type:

Soup.Message

New in version 3.26.

options_sync(uri, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

Whether succeeded.

out_capabilities:

return location for DAV capabilities

out_allows:

return location for allowed operations

Return type:

(bool, out_capabilities: {object: object}, out_allows: {object: object})

Issues OPTIONS request on the provided uri, or, in case it’s None, on the URI defined in associated EDataServer.Source.

The out_capabilities contains a set of returned capabilities. Some known are defined as EDataServer.WEBDAV_CAPABILITY_CLASS_1, and so on. The ‘value’ of the GLib.HashTable doesn’t have any particular meaning and the strings are compared case insensitively. Free the hash table with GLib.HashTable.destroy(), when no longer needed. The returned value can be None on success, it’s when the server doesn’t provide the information.

The out_allows contains a set of allowed methods returned by the server. Some known are defined as %SOUP_METHOD_OPTIONS, and so on. The ‘value’ of the GLib.HashTable doesn’t have any particular meaning and the strings are compared case insensitively. Free the hash table with GLib.HashTable.destroy(), when no longer needed. The returned value can be None on success, it’s when the server doesn’t provide the information.

New in version 3.26.

post_sync(uri, data, data_length, in_content_type, in_headers, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

Whether succeeded.

out_content_type:

return location for response Content-Type, or None

out_headers:

optional return location for response Soup.MessageHeaders, or None

out_content:

return location for response content, or None

Return type:

(bool, out_content_type: str or None, out_headers: Soup.MessageHeaders, out_content: bytes)

Issues POST request on the provided uri, or, in case it’s None, on the URI defined in associated EDataServer.Source.

The optional in_headers can contain additional headers to be added to the request. These headers replace any existing in the request headers, without support for the list-values headers.

The optional out_content_type can be used to get content type of the response. Free it with GLib.free(), when no longer needed.

The optional out_headers contains response headers. Free it with soup_message_headers_free(), when no longer needed.

The optional out_content can be used to get actual result content. Free it with GLib.ByteArray.free(), when no longer needed.

New in version 3.32.

principal_property_search_sync(uri, apply_to_principal_collection_set, match_ns_uri, match_property, match_value, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

Whether succeeded. Note it can report success also when no matching principal had been found.

out_principals:

return location for matching principals

Return type:

(bool, out_principals: [EDataServer.WebDAVResource])

Issues a DAV:principal-property-search for the uri, or, in case it’s None, for the URI defined in associated EDataServer.Source. The DAV:principal-property-search performs a search for all principals whose properties contain character data that matches the search criteria match_value in match_property property of namespace match_ns_uri.

By default, the function searches all members (at any depth) of the collection identified by the uri. If apply_to_principal_collection_set is set to True, the search is applied instead to each collection returned by EDataServer.WebDAVSession.get_principal_collection_set_sync() for the uri.

The out_principals is a GLib.SList of EDataServer.WebDAVResource, where the kind is set to EDataServer.WebDAVResourceKind.PRINCIPAL and only href with displayname are filled. All other members of EDataServer.WebDAVResource are not set.

Free the returned out_principals with g_slist_free_full (principals, EDataServer.WebDAVResource.free); when no longer needed.

New in version 3.26.

propfind_sync(uri, depth, xml, func, func_user_data, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

Whether succeeded.

Return type:

bool

Issues PROPFIND request on the provided uri, or, in case it’s None, on the URI defined in associated EDataServer.Source. On success, calls func for each returned DAV:propstat.

The xml can be None, in which case the server should behave like DAV:allprop request.

New in version 3.26.

proppatch_sync(uri, xml, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

Whether succeeded.

Return type:

bool

Issues PROPPATCH request on the provided uri, or, in case it’s None, on the URI defined in associated EDataServer.Source, with the changes. The order of requested changes inside xml is significant, unlike on other places.

New in version 3.26.

put_data_sync(uri, etag, content_type, in_headers, bytes, length, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

Whether succeeded.

out_href:

optional return location for href of the resource, or None

out_etag:

optional return location for etag of the resource, or None

out_headers:

optional return location for response Soup.MessageHeaders, or None

Return type:

(bool, out_href: str or None, out_etag: str or None, out_headers: Soup.MessageHeaders)

Writes data to a resource identified by uri to the server. The URI cannot reference a collection.

The etag argument is used to avoid clashes when overwriting existing resources. It can contain three values:

  • None - to write completely new resource

  • empty string - write new resource or overwrite any existing, regardless changes on the server

  • valid ETag - overwrite existing resource only if it wasn’t changed on the server.

Note that the actual usage of etag is also influenced by EDataServer.SourceWebdav :avoid-ifmatch property of the associated EDataServer.Source.

The optional in_headers can contain additional headers to be added to the request. These headers replace any existing in the request headers, without support for the list-values headers.

The out_href, if provided, is filled with the resulting URI of the written resource. It can be different from the uri when the server redirected to a different location.

The out_etag contains ETag of the resource after it had been saved.

The optional out_headers contains response headers. Free it with soup_message_headers_free(), when no longer needed.

To write large data use EDataServer.WebDAVSession.put_sync() instead.

New in version 3.26.

put_sync(uri, etag, content_type, in_headers, stream, stream_length, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

Whether succeeded.

out_href:

optional return location for href of the resource, or None

out_etag:

optional return location for etag of the resource, or None

out_headers:

optional return location for response Soup.MessageHeaders, or None

Return type:

(bool, out_href: str or None, out_etag: str or None, out_headers: Soup.MessageHeaders)

Writes data from stream to a resource identified by uri to the server. The URI cannot reference a collection.

The etag argument is used to avoid clashes when overwriting existing resources. It can contain three values:

  • None - to write completely new resource

  • empty string - write new resource or overwrite any existing, regardless changes on the server

  • valid ETag - overwrite existing resource only if it wasn’t changed on the server.

Note that the actual behaviour is also influenced by EDataServer.SourceWebdav :avoid-ifmatch property of the associated EDataServer.Source.

The optional in_headers can contain additional headers to be added to the request. These headers replace any existing in the request headers, without support for the list-values headers.

The out_href, if provided, is filled with the resulting URI of the written resource. It can be different from the uri when the server redirected to a different location.

The out_etag contains ETag of the resource after it had been saved.

The optional out_headers contains response headers. Free it with soup_message_headers_free(), when no longer needed.

The stream should support also Gio.Seekable interface, because the data send can require restart of the send due to redirect or other reasons.

This method uses Transfer-Encoding:chunked, in contrast to the EDataServer.WebDAVSession.put_data_sync(), which writes data stored in memory like any other request.

New in version 3.26.

refresh_lock_sync(uri, lock_token, lock_timeout, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

Whether succeeded.

Return type:

bool

Refreshes existing lock lock_token for a resource identified by uri, or, in case it’s None, on the URI defined in associated EDataServer.Source. The lock_token is returned from EDataServer.WebDAVSession.lock_sync() and the uri should be the same as that used with EDataServer.WebDAVSession.lock_sync().

New in version 3.26.

replace_with_detailed_error(message, response_data, ignore_multistatus, prefix)
Parameters:
Raises:

GLib.Error

Returns:

Whether any detailed error had been recognized.

Return type:

bool

Tries to read detailed error information from response_data, if not provided, then from message's response_body. If the detailed error cannot be found, then does nothing, otherwise frees the content of inout_error, if any, and then populates it with an error message prefixed with prefix.

The prefix might be of form “Failed to something”, because the resulting error message will be: “Failed to something: HTTP error code XXX (reason_phrase): detailed_error”. When prefix is None, the error message will be: “Failed with HTTP error code XXX (reason phrase): detailed_error”.

As the caller might not be interested in errors, also the inout_error can be None, in which case the function does nothing.

New in version 3.26.

report_sync(uri, depth, xml, func, func_user_data, out_content_type, out_content, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

Whether succeeded.

Return type:

bool

Issues REPORT request on the provided uri, or, in case it’s None, on the URI defined in associated EDataServer.Source. On success, calls func for each returned DAV:propstat.

The report can result in a multistatus response, but also to raw data. In case the func is provided and the result is a multistatus response, then it is traversed using this func.

The optional out_content_type can be used to get content type of the response. Free it with GLib.free(), when no longer needed.

The optional out_content can be used to get actual result content. Free it with GLib.ByteArray.free(), when no longer needed.

New in version 3.26.

set_acl_sync(uri, entries, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

Whether succeeded.

Return type:

bool

Changes Access Control List (ACL) for the uri, or, in case it’s None, for the URI defined in associated EDataServer.Source.

Make sure that the entries satisfy ACL restrictions, as returned by EDataServer.WebDAVSession.get_acl_restrictions_sync(). The order in the entries is preserved. It cannot contain any EDataServer.WebDAVACEFlag.PROTECTED, nor EDataServer.WebDAVACEFlag.INHERITED, items.

Use EDataServer.WebDAVSession.get_acl_sync() to read currently known ACL entries, remove from the list those protected and inherited, and then modify the rest with the required changed.

Note this function doesn’t support general EDataServer.WebDAVACEPrincipalKind.PROPERTY and returns Gio.IOErrorEnum.NOT_SUPPORTED error when any such is tried to be written.

In case the returned entries contain any EDataServer.WebDAVACEPrincipalKind.PROPERTY, or there’s a need to write such Access Control Entry, then do not use EDataServer.WebDAVSession.get_acl_sync(), neither EDataServer.WebDAVSession.set_acl_sync(), and write more generic implementation.

New in version 3.26.

traverse_mkcalendar_response(message, xml_data, func, *func_user_data)
Parameters:
Raises:

GLib.Error

Returns:

Whether succeeded.

Return type:

bool

Traverses a CALDAV:mkcalendar-response response and calls func for each returned DAV:propstat.

The message, if provided, is used to verify that the response is an XML Content-Type. It’s used to get the request URI as well.

New in version 3.26.

traverse_mkcol_response(message, xml_data, func, *func_user_data)
Parameters:
Raises:

GLib.Error

Returns:

Whether succeeded.

Return type:

bool

Traverses a DAV:mkcol-response response and calls func for each returned DAV:propstat.

The message, if provided, is used to verify that the response is an XML Content-Type. It’s used to get the request URI as well.

New in version 3.26.

traverse_multistatus_response(message, xml_data, func, *func_user_data)
Parameters:
Raises:

GLib.Error

Returns:

Whether succeeded.

Return type:

bool

Traverses a DAV:multistatus response and calls func for each returned DAV:propstat.

The message, if provided, is used to verify that the response is a multi-status and that the Content-Type is properly set. It’s used to get a request URI as well.

New in version 3.26.

unlock_sync(uri, lock_token, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

Whether succeeded.

Return type:

bool

Releases (unlocks) existing lock lock_token for a resource identified by uri, or, in case it’s None, on the URI defined in associated EDataServer.Source. The lock_token is returned from EDataServer.WebDAVSession.lock_sync() and the uri should be the same as that used with EDataServer.WebDAVSession.lock_sync().

New in version 3.26.

update_properties_sync(uri, changes, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

Whether succeeded.

Return type:

bool

Updates properties (set/remove) on the provided uri, or, in case it’s None, on the URI defined in associated EDataServer.Source, with the changes. The order of changes is significant, unlike on other places.

This function supports only flat properties, those not under other element. To support more complex property tries use EDataServer.WebDAVSession.proppatch_sync() directly.

New in version 3.26.