Skip to content

[webdav.xml]: Document methods for changing how file sizes are determined in WebDAV #803

Open
@joewiz

Description

@joewiz

Describe the problem

eXist's WebDAV article should include documentation about the feature introduced in eXist-db/exist@2c6e455. I'd propose this draft - comments welcome! I'd especially appreciate review of the text by @dizzzz, who created the feature.


WebDAV clients typically display the size of files in a directory or use this information when downloading a resource. While the size of binary files can be easily determined in the file system, this is not so for XML documents stored in eXist-db. This is because exact size of an XML document is dependent on serialization parameters (e.g., indentation), and eXist-db does not store XML documents in a serialized form. Calculating the exact size of a document for a given set of serialization would require serializing it, which could slow down the process of listing the contents of a collection. Thus, by default, eXist-db presents WebDAV clients with an "approximate" size of documents, calculated by multiplying the "page size" by the "number of pages" used to store a document in the database. The approximate size is a good indication of the size of documents, but some WebDAV clients cannot deal with this approximation, causing downloaded resources to be improperly truncated or padded.

Two system variables can be set to change the way the size is calculated. They must be set at eXist-db's startup time. The properties are:

  1. org.exist.webdav.PROPFIND_METHOD_XML_SIZE
  2. org.exist.webdav.GET_METHOD_XML_SIZE

The available values for these properties are:

  1. NULL (no size reported; fastest)
  2. APPROXIMATE (an approximate size is provided but is not guaranteed to be correct; fast)
  3. EXACT (exact size is reported, by first serializing the document to measure its length; slowest)

The defaults for each property are as follows:

  • PROPFIND: By default, the PROPFIND property is set to APPROXIMATE by default. The exception is the macOS Finder WebDAV client, which cannot handle the values NULL or APPROXIMATE. Thus, for compatibility, eXist-db checks the user agent string and always sets this property to EXACT for the macOS Finder.
  • GET: By default, the GET property is set to NULL (and this value works well for macOS).

Screenshots

n/a

Please provide the following

  • exist-db version: 6.1.0-SNAPSHOT
  • documentation version: 5.4.0

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions