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-9453: Correct separator when checking smb path #9454

Merged
merged 1 commit into from
Sep 13, 2024

Conversation

pfosser
Copy link
Contributor

@pfosser pfosser commented Sep 12, 2024

Fixes: #9453
Issue link: #9453

On a smb file upload, to detect the need for new remote directories, the remote path was checked for the local filesystem path separator. On Windows that is \ which is never found in a smb path, so the necessary remote path was not created and the operation failed.

Use the correct separator which was already available as a constant.

@pivotal-cla This is an Obvious Fix

@pivotal-cla
Copy link

@pfosser Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@pivotal-cla
Copy link

@pfosser This Pull Request contains an obvious fix. Signing the Contributor License Agreement is not necessary.

Copy link
Member

@artembilan artembilan left a comment

Choose a reason for hiding this comment

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

Add your name to the @author list of that affected class.

Thanks

import org.springframework.core.log.LogAccessor;
import org.springframework.integration.file.remote.session.Session;
import org.springframework.util.Assert;
import org.springframework.util.FileCopyUtils;
import org.springframework.util.StringUtils;

import jcifs.smb.SmbException;
import jcifs.smb.SmbFile;
import jcifs.smb.SmbFileOutputStream;
Copy link
Member

Choose a reason for hiding this comment

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

This is not correct change.
Please, consider to revert imports order.

Copy link
Member

@artembilan artembilan left a comment

Choose a reason for hiding this comment

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

The build fails clearly with that import order problem:

Error: eckstyle] [ERROR] /home/runner/work/spring-integration/spring-integration/spring-integration-smb/src/main/java/org/springframework/integration/smb/session/SmbSession.java:34:1: Wrong order for 'jcifs.smb.SmbException' import. [ImportOrder]

Consider to run ./gradlew :spring-integration-smb:check before pushing changes to the PR.

Thanks

Fixes: spring-projects#9453
Issue link: spring-projects#9453

On a smb file upload, to detect the need for new remote directories,
the remote path was checked for the local filesystem path separator.
On Windows that is \\ which is never found in a smb path, so the
necessary remote path was not created and the operation failed.

Use the correct separator which was already available as a
constant.
@artembilan artembilan merged commit 4cccee7 into spring-projects:main Sep 13, 2024
3 checks passed
@artembilan
Copy link
Member

@pfosser ,

thank you for contribution; looking forward for more!

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.

Spring Integration Smb upload fails to create missing remote directory when running on Windows
3 participants