Skip to content

refactor: move binary files out of DaprClientImpl - #1907

Open
javier-aliaga wants to merge 1 commit into
dapr:masterfrom
javier-aliaga:refactor/split-daprclientimpl-binaryfiles
Open

javier-aliaga wants to merge 1 commit into
dapr:masterfrom
javier-aliaga:refactor/split-daprclientimpl-binaryfiles

Conversation

@javier-aliaga

Copy link
Copy Markdown
Contributor

Description

Fifth step of splitting DaprClientImpl into package-private classes, one per building block. This PR moves the binary file API (alpha).

  • New package-private class DaprBinaryFileClient holds deleteBinaryFile, getBinaryFile, getBinaryFileBytes and both setBinaryFile overloads, plus validateBinaryFileArgs, splitBinaryFileChunk and the BINARY_FILE_CHUNK_SIZE constant. The bodies are unchanged.
  • One line inside the moved code changes. The method reference DaprClientImpl::splitBinaryFileChunk now names DaprBinaryFileClient::splitBinaryFileChunk.
  • The public methods on DaprClientImpl keep their signatures and Javadoc, and delegate in one line.
  • No public API change. DaprClientImpl goes from 1,829 to 1,606 lines.

Issue reference

Part of #1875

Checklist

  • Code compiles correctly
  • Created/updated tests. DaprPreviewClientGrpcTest covers binary files through the public methods. The 626 sdk unit tests pass unchanged.
  • Extended the documentation. Not needed, internal change.

Move deleteBinaryFile, getBinaryFile, getBinaryFileBytes and both
setBinaryFile overloads, with their validation, chunking helper and chunk
size constant, into a package-private DaprBinaryFileClient. The public
methods on DaprClientImpl now delegate to it.

Part of dapr#1875

Signed-off-by: Javier Aliaga <javier@diagrid.io>
Copilot AI lite review requested due to automatic review settings November 13, 2026 09:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The reviewed refactoring cleanly separates binary file operations into a package-private helper while preserving the existing public API and behavior, with no outstanding review concerns.

No open issues 🎉

What changed in this PR

This pull request extracts the alpha binary file operations from DaprClientImpl into a package-private DaprBinaryFileClient while preserving the existing public API and behavior.

Changes:

  • Added DaprBinaryFileClient with binary file validation, upload, download, deletion, streaming, and chunking logic.
  • Updated DaprClientImpl to initialize the helper and delegate its public binary file methods.
  • Updated the binary upload chunking method reference to use the new helper class.
File Description
sdk/​src/​main/​java/​io/​dapr/​client/​DaprClientImpl.java Initializes the binary file client and delegates the public binary file methods while retaining their signatures and documentation.
sdk/​src/​main/​java/​io/​dapr/​client/​DaprBinaryFileClient.java Provides the extracted package-private implementation for binary file operations, validation, and upload chunking.

Review effort: Lite

@javier-aliaga
javier-aliaga marked this pull request as ready for review November 13, 2026 10:06
@javier-aliaga
javier-aliaga requested review from a team as code owners November 13, 2026 10:06
@codecov

codecov Bot commented Nov 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.97%. Comparing base (9d51882) to head (1c019c9).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1907      +/-   ##
============================================
+ Coverage     81.96%   81.97%   +0.01%     
- Complexity     3663     3669       +6     
============================================
  Files           331      332       +1     
  Lines         11367    11376       +9     
  Branches       1290     1290              
============================================
+ Hits           9317     9326       +9     
  Misses         1556     1556              
  Partials        494      494              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants