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 2024/10/30 09:46:29 UTC
(camel) branch main updated: CAMEL-21397 - camel-file - fix autoCreateStepwise for Windows environments (#16107)
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 025347fbb6c CAMEL-21397 - camel-file - fix autoCreateStepwise for Windows environments (#16107)
025347fbb6c is described below
commit 025347fbb6cb8a41abcea374e9158b4ecea039c3
Author: s-clauw <15...@users.noreply.github.com>
AuthorDate: Wed Oct 30 10:46:23 2024 +0100
CAMEL-21397 - camel-file - fix autoCreateStepwise for Windows environments (#16107)
* CAMEL-21287: Camel-Azure-Files add missing header for AZURE_IDENTITY
The header x-ms-file-request-intent must be set before calling the file share api using a bearer token.
* Fix creating directory when autoCreateStepwise is try and no permisisons are set
* fix (CAMEL-21397): handle UNC server paths on Windows
* Revert "fix (CAMEL-21397): handle UNC server paths on Windows"
This reverts commit ac21fefbe839de641ffc8dc8bf2b655c88c03472.
---------
Co-authored-by: Clemens Blamauer <c....@esm.europa.eu>
---
.../main/java/org/apache/camel/component/file/FileOperations.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/components/camel-file/src/main/java/org/apache/camel/component/file/FileOperations.java b/components/camel-file/src/main/java/org/apache/camel/component/file/FileOperations.java
index 7c4a3e56301..0672db7e104 100644
--- a/components/camel-file/src/main/java/org/apache/camel/component/file/FileOperations.java
+++ b/components/camel-file/src/main/java/org/apache/camel/component/file/FileOperations.java
@@ -110,7 +110,9 @@ public class FileOperations implements GenericFileOperations<File> {
return true;
}
- if (!stepwise && (permissions == null || permissions.isEmpty())) {
+ boolean hasPermissions = permissions != null && !permissions.isEmpty();
+
+ if (!stepwise && !hasPermissions) {
return dir.mkdirs();
}
@@ -130,7 +132,7 @@ public class FileOperations implements GenericFileOperations<File> {
File subDir = new File(base, part);
if (!subDir.exists()) {
if (subDir.mkdir()) {
- if (permissions != null) {
+ if (hasPermissions) {
if (LOG.isTraceEnabled()) {
LOG.trace("Setting chmod: {} on directory: {}", PosixFilePermissions.toString(permissions),
subDir);