javahttpwebdavjackrabbit

How does Jackrabbit WebDAV generate eTag header?


I have a Jackrabbit WebDAV server running in Tomcat and I want to know how ETag header value is generated. What class is producing it?

How it can be generated using Java based on initial file and it path in Jackrabbit repository?

The intended flow:

  1. Initial file upload to the server
  2. If the client is uploading a new file: calculate ETag and compare it with corresponding ETag of file on the server.
  3. If values the same - do not upload the file, send response to the client. If values deffer - replace the file on server.

Solution

  • I believe the server will use the jcr:etag property (https://docs.adobe.com/content/docs/en/spec/jcr/2.0/3_Repository_Model.html#3.7.12.1%20mix:etag), otherwise will try to generate something based on timestamp and file length.