sequenceDiagram
participant Finder as 客户端(Finder)
participant Server as WebDAV 服务端

Note over Finder,Server: 1. 探测服务器能力
Finder->>Server: OPTIONS /path/ HTTP/1.1
Server–>>Finder: 200 OK, Allow: OPTIONS, GET, PUT, PROPFIND, LOCK, … 【RFC 4918】​:contentReference[oaicite:10]{index=10}

Note over Finder,Server: 2. 列出目录内容
Finder->>Server: PROPFIND /path/ (Depth:1)【RFC 4918 §9.1】
Server–>>Finder: 207 Multi-Status (目录 XML 列表)【​:contentReference[oaicite:11]{index=11}】

Note over Finder,Server: 3. 创建空文件(0 字节)
Finder->>Server: PUT /path/foo.txt (Transfer-Encoding: chunked, 0 bytes)
Server–>>Finder: 201 Created【​:contentReference[oaicite:12]{index=12}】【​:contentReference[oaicite:13]{index=13}】

Note over Finder,Server: 4. 写入文件内容
Finder->>Server: PUT /path/foo.txt (Transfer-Encoding: chunked, 实际内容)
Server–>>Finder: 200 OK【​:contentReference[oaicite:14]{index=14}】

Note over Finder,Server: 5. (可选)加锁/解锁
Finder->>Server: LOCK /path/foo.txt
Server–>>Finder: 200 OK
Finder->>Server: UNLOCK /path/foo.txt
Server–>>Finder: 204 No Content【​:contentReference[oaicite:15]{index=15}】

Note over Finder,Server: 6. 刷新属性或目录
Finder->>Server: PROPFIND /path/foo.txt (Depth:0)
Server–>>Finder: 207 Multi-Status (单资源属性)【​:contentReference[oaicite:16]{index=16}】

Note over Finder,Server: 7. (微软示例:读回文件以确认)
Finder->>Server: GET /path/foo.txt
Server–>>Finder: 200 OK + 内容【​:contentReference[oaicite:17]{index=17}】

img.png

🔍 Finder 的行为
在访问 WebDAV 共享目录时,Finder 会执行以下操作:
1.发送 PROPFIND 请求以获取目录列表。
2.对目录中的每个文件,尝试访问对应的 ._ 文件,以获取资源分支和元数据。
3.如果 ._ 文件不存在,Finder 会继续处理原始文件,但可能会导致加载延迟。

这种行为可能导致 WebDAV 服务器日志中出现大量对 ._ 文件的 PROPFIND 请求,并且在所有请求完成之前,Finder 可能不会显示文件列表

class _DAVResource(ABC):

  • get_content_length
  • get_content_type
  • get_creation_date
  • get_directory_info
  • get_display_name
  • get_display_info
  • get_etag
  • get_used_bytes
  • get_available_bytes
  • get_last_modified
  • get_member():
  • get_member_list

class DAVNonCollection(_DAVResource):

class DAVCollection(_DAVResource):

class DAVProvider(ABC):

__END__