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 f6ae9ecad39b CAMEL-24159: camel-azure-storage-datalake - Fix 
medium-severity bugs from code review
f6ae9ecad39b is described below

commit f6ae9ecad39b89936611e3ab56d307d4f4d34924
Author: Claus Ibsen <[email protected]>
AuthorDate: Fri Jul 17 22:42:41 2026 +0200

    CAMEL-24159: camel-azure-storage-datalake - Fix medium-severity bugs from 
code review
    
    Co-Authored-By: Claude Opus 4.6 <[email protected]>
---
 .../azure/storage/datalake/DataLakeComponent.java          | 14 ++++++++------
 .../datalake/operations/DataLakeFileOperations.java        |  9 +++++++--
 2 files changed, 15 insertions(+), 8 deletions(-)

diff --git 
a/components/camel-azure/camel-azure-storage-datalake/src/main/java/org/apache/camel/component/azure/storage/datalake/DataLakeComponent.java
 
b/components/camel-azure/camel-azure-storage-datalake/src/main/java/org/apache/camel/component/azure/storage/datalake/DataLakeComponent.java
index c486e4fe3826..8a58657bbfdf 100644
--- 
a/components/camel-azure/camel-azure-storage-datalake/src/main/java/org/apache/camel/component/azure/storage/datalake/DataLakeComponent.java
+++ 
b/components/camel-azure/camel-azure-storage-datalake/src/main/java/org/apache/camel/component/azure/storage/datalake/DataLakeComponent.java
@@ -71,12 +71,14 @@ public class DataLakeComponent extends HealthCheckComponent 
{
                     
configuration.setCredentialType(CredentialType.CLIENT_SECRET);
                 }
             } else {
-                if (configuration.getSharedKeyCredential() != null) {
-                    
configuration.setCredentialType(CredentialType.SHARED_KEY_CREDENTIAL);
-                } else if (configuration.getSasCredential() != null) {
-                    configuration.setCredentialType(CredentialType.AZURE_SAS);
-                } else if (configuration.getClientSecretCredential() != null) {
-                    
configuration.setCredentialType(CredentialType.CLIENT_SECRET);
+                if (configuration.getCredentialType() == null) {
+                    if (configuration.getSharedKeyCredential() != null) {
+                        
configuration.setCredentialType(CredentialType.SHARED_KEY_CREDENTIAL);
+                    } else if (configuration.getSasCredential() != null) {
+                        
configuration.setCredentialType(CredentialType.AZURE_SAS);
+                    } else if (configuration.getClientSecretCredential() != 
null) {
+                        
configuration.setCredentialType(CredentialType.CLIENT_SECRET);
+                    }
                 }
             }
         }
diff --git 
a/components/camel-azure/camel-azure-storage-datalake/src/main/java/org/apache/camel/component/azure/storage/datalake/operations/DataLakeFileOperations.java
 
b/components/camel-azure/camel-azure-storage-datalake/src/main/java/org/apache/camel/component/azure/storage/datalake/operations/DataLakeFileOperations.java
index 0307ad8469a9..9de5d07909c4 100644
--- 
a/components/camel-azure/camel-azure-storage-datalake/src/main/java/org/apache/camel/component/azure/storage/datalake/operations/DataLakeFileOperations.java
+++ 
b/components/camel-azure/camel-azure-storage-datalake/src/main/java/org/apache/camel/component/azure/storage/datalake/operations/DataLakeFileOperations.java
@@ -108,6 +108,11 @@ public class DataLakeFileOperations {
         }
         final DataLakeFileClientWrapper fileClientWrapper = 
getFileClientWrapper(exchange);
         final File recieverFile = 
AzureFileNameHelper.resolveWithinDirectory(fileDir, 
fileClientWrapper.getFileName());
+        File parentDir = recieverFile.getParentFile();
+        if (parentDir != null) {
+            parentDir.mkdirs();
+        }
+        recieverFile.delete();
         final FileCommonRequestOptions commonRequestOptions = 
getCommonRequestOptions(exchange);
         final FileRange fileRange = configurationProxy.getFileRange(exchange);
         final ParallelTransferOptions parallelTransferOptions = 
configurationProxy.getParallelTransferOptions(exchange);
@@ -183,8 +188,9 @@ public class DataLakeFileOperations {
         final Boolean retainUncommitedData = 
configurationProxy.retainUnCommitedData(exchange);
         final Boolean close = configurationProxy.getClose(exchange);
         final DataLakeFileClientWrapper fileClientWrapper = 
getFileClientWrapper(exchange);
+        final long flushPosition = (position != null ? position : 0L) + 
fileClientWrapper.getFileSize();
         final Response<PathInfo> response
-                = fileClientWrapper.flushWithResponse(position + 
fileClientWrapper.getFileSize(), retainUncommitedData, close,
+                = fileClientWrapper.flushWithResponse(flushPosition, 
retainUncommitedData, close,
                         commonRequestOptions.getPathHttpHeaders(), 
commonRequestOptions.getRequestConditions(),
                         commonRequestOptions.getTimeout());
         DataLakeExchangeHeaders exchangeHeaders
@@ -215,7 +221,6 @@ public class DataLakeFileOperations {
                 = new FileParallelUploadOptions(is)
                         
.setHeaders(commonRequestOptions.getPathHttpHeaders()).setParallelTransferOptions(transferOptions)
                         
.setMetadata(commonRequestOptions.getMetadata()).setPermissions(permission)
-                        
.setRequestConditions(commonRequestOptions.getRequestConditions())
                         
.setRequestConditions(commonRequestOptions.getRequestConditions()).setUmask(umask);
         final DataLakeFileClientWrapper fileClientWrapper = 
getFileClientWrapper(exchange);
         final Response<PathInfo> response

Reply via email to