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

GH-8800: Fix SMB Gateway for recursive MGET #8801

Closed
wants to merge 1 commit into from

Conversation

artembilan
Copy link
Member

Fixes: gh-8800

The SmbFile.getName() returns plain file name, not with a sub-directory as it is expected by the AbstractRemoteFileOutboundGateway for (S)FTP protocols

  • Introduce AbstractRemoteFileOutboundGateway.getFullFileName() with dir and file name concatenation by default (as it was before) and override it in the SmbOutboundGateway to return the full path according this protocol.
  • Fix SmbOutboundGateway.enhanceNameWithSubDirectory() to return an SmbFile instance since it has all the info about remote file, include requested directory
  • Fix SmbOutboundGateway.getFilename() to remove the trailing / in the dir name since this is not what expected by the AbstractRemoteFileOutboundGateway logic

Cherry-pick to 6.1.x

Fixes: spring-projectsgh-8800

The `SmbFile.getName()` returns plain file name, not with a
sub-directory as it is expected by the `AbstractRemoteFileOutboundGateway`
for (S)FTP protocols

* Introduce `AbstractRemoteFileOutboundGateway.getFullFileName()`
with dir and file name concatenation by default (as it was before)
and override it in the `SmbOutboundGateway` to return the full path according this protocol.
* Fix `SmbOutboundGateway.enhanceNameWithSubDirectory()` to return an `SmbFile` instance
since it has all the info about remote file, include requested directory
* Fix `SmbOutboundGateway.getFilename()` to remove the trailing `/` in the dir name
since this is not what expected by the `AbstractRemoteFileOutboundGateway` logic

**Cherry-pick to `6.1.x`**
@artembilan artembilan requested a review from tzolov December 6, 2023 15:19
@artembilan
Copy link
Member Author

NOTE: I ma changing our commit pattern to meet Backport Bot requirements: https://github.com/spring-io/backport-bot.
Essentially we change the Fixes: <URL> approach to just (Fixes|Closes): gh-\d+.
What I mean with this is supposed to be an automatically created back-port issue for a maintain branch we are going to cherry-pick the fix.

@artembilan
Copy link
Member Author

Merged and cherry-picked to 6.1.x

@artembilan artembilan closed this Dec 6, 2023
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.

The SMB MGET doesn't work as expected
1 participant