Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
joewiz opened this issue Jul 6, 2022 · 2 comments
Assignees

Comments

@joewiz
Copy link
Member

joewiz commented Jul 6, 2022

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
@adamretter
Copy link
Contributor

This is a great piece of documentation and we should merge this as soon as possible. @joewiz thank you for writing up this complex issue in an accessible way

@adamretter
Copy link
Contributor

I wonder where the best place to put this is? Perhaps in http://www.exist-db.org/exist/apps/doc/webdav under the Compatibility section, which mentions the issue with sizing already in brief, but doesn't mention that there is an option to change the calculation.

@dizzzz dizzzz self-assigned this Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants