This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch backport/24255-to-camel-4.18.x
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 42f3c0e0859e2be89d779c4984bb924faabb6593
Author: Claus Ibsen <[email protected]>
AuthorDate: Fri Jun 26 07:38:31 2026 +0200

    CAMEL-23834: camel-smb - Fix forward slashes rejected on Windows during 
atomic rename (#24255)
    
    Signed-off-by: Claus Ibsen <[email protected]>
    Co-authored-by: Claude <[email protected]>
---
 .../src/main/java/org/apache/camel/component/smb/SmbOperations.java    | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/components/camel-smb/src/main/java/org/apache/camel/component/smb/SmbOperations.java
 
b/components/camel-smb/src/main/java/org/apache/camel/component/smb/SmbOperations.java
index e5a382c6ec26..981f76eaa770 100644
--- 
a/components/camel-smb/src/main/java/org/apache/camel/component/smb/SmbOperations.java
+++ 
b/components/camel-smb/src/main/java/org/apache/camel/component/smb/SmbOperations.java
@@ -225,7 +225,8 @@ public class SmbOperations implements SmbFileOperations {
     public boolean atomicRenameFile(File src, String to)
             throws GenericFileOperationFailedException {
         try {
-            src.rename(to);
+            // SMB protocol requires backslashes as path separators
+            src.rename(to.replace('/', '\\'));
             LOG.debug("Renamed file: {} to: {} using atomic rename", 
src.getUncPath(), to);
             return true;
         } catch (SMBRuntimeException e) {

Reply via email to