You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2023/07/19 16:27:08 UTC
[camel] branch camel-3.x updated: CAMEL-19615 chmodDirectory option try for each junk to change the directory permission and fails (#10730)
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch camel-3.x
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-3.x by this push:
new b786035ebbd CAMEL-19615 chmodDirectory option try for each junk to change the directory permission and fails (#10730)
b786035ebbd is described below
commit b786035ebbd6d408c3af4732fc4ac0d5ca7690e0
Author: Michael R <mi...@rambichler.at>
AuthorDate: Wed Jul 19 18:27:01 2023 +0200
CAMEL-19615 chmodDirectory option try for each junk to change the directory permission and fails (#10730)
Co-authored-by: at00191173 <mi...@spar-ics.com>
---
.../apache/camel/component/file/remote/SftpOperations.java | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java
index 974d6a3c592..7e776ab2ebc 100644
--- a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java
+++ b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java
@@ -577,8 +577,10 @@ public class SftpOperations implements RemoteFileOperations<SftpRemoteFile> {
success = buildDirectoryChunks(directory);
}
- // after creating directory, we may set chmod on the file
- chmodOfDirectory(directory);
+ // only after successfully creating directory, we may set chmod on the file
+ if (success) {
+ chmodOfDirectory(directory);
+ }
}
} catch (SftpException e) {
throw new GenericFileOperationFailedException("Cannot build directory: " + directory, e);
@@ -619,8 +621,10 @@ public class SftpOperations implements RemoteFileOperations<SftpRemoteFile> {
// ignore keep trying to create the rest of the path
}
- // after creating directory, we may set chmod on the file
- chmodOfDirectory(directory);
+ // only after successfully creating directory, we may set chmod on the file
+ if (success) {
+ chmodOfDirectory(directory);
+ }
}
}