← Back to Pull requests

Reimplement the WebDAV file connector on Sardine #546

Open
unknown opened this pull request with 332 lines diff across 4 files
View on GitHub
unknown unknown commented on Oct 30, 2026 10:44 UTC
Author

What

Rewrites the File connector's WebDavConnection on Sardine 5.10, an Apache 2.0 WebDAV client built on httpclient 4.5. It also removes the vendored webdavclient4j-core-0.92.jar, a 2008 Jakarta Slide build on commons-httpclient 3.

Why

webdavclient4j has been dead since 2008 and was the last real user of commons-httpclient 3.0.1. WebDAV has also been broken since 4.5.0: Slide needs jdom 1, which was replaced by jdom2.

Sardine 5.10 is the last release on javax.xml.bind, which the engine already ships. 5.11 and later need Jakarta JAXB 4, and their org.glassfish.jaxb:jaxb-runtime would clash with ours (2.4). Sardine is added with transitive = false, so the only new jar is sardine-5.10.jar, in extensions/file/lib.

Reviewer notes

  • WebDavConnection uses plain Sardine. Sardine handles the requests, multistatus parsing, PROPFIND redirects and authentication. WebDavConnection only maps its results onto FileSystemConnection.

  • Authentication is challenge-response (NTLM, then Digest, then Basic). PUT bodies come from FileDispatcher as a ByteArrayInputStream. They are wrapped in a small entity that resets the stream, so a PUT can be resent after a challenge without copying the payload. Other streams use Expect: 100-continue.

  • Any HTTP response counts as connected. Only an I/O error marks the connection invalid.

  • canWrite only checks that the directory exists. It no longer checks for write locks: checking first is racy, and a failed write is logged when it happens.

  • WebDavConnectionTest mocks the Sardine interface, like the SMB and FTP tests. List, read, write with MKCOL, move and delete were also checked by hand against Apache mod_dav.

  • Fixed along the way, all already broken on main:

  • - The configured port was ignored, so WebDAV always used port 80 or 443.
    - No connect or read timeouts were set. They now use the connector's timeout setting.
    - Listing returned wrong child paths, zero sizes and dates, and no directories.
  • Credentials are scoped to the target host and port.

  • Behavior change: TLS hostname verification is now on. commons-httpclient 3 never checked the hostname, so a server whose certificate doesn't match the configured host now fails the handshake. Worth a line in the release notes.

  • Not tested: NTLM, IIS and Nextcloud.

  • Follow-ups:

  • - Failed PUT, DELETE and MOVE are still only logged, as before. See the comment on this PR.
    - commons-httpclient 3 can be removed once this, the HttpStatus change and the HTTPUtil change are merged.

    🤖 Generated with Claude Code

    Diff: 332 lines (+249 / -83) across 4 files Reviewer: tonygermano Review duration: 46650m
    All Vouch review confidence checks passed
    Residual risk 0.27 = Change Risk (0.49) × (1 − Review Confidence (0.45)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.49 · 332 lines diff across 4 files
    0.49
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    44%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.347
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #546"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 44.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 49.1% (MEDIUM) · Higher = larger blast radius
    49.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 44.7% · Lower = rushed or shallow review
    44.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 27.2% · Safe to merge
    27.2%