timeabarna commented on a change in pull request #5098:
URL: https://github.com/apache/nifi/pull/5098#discussion_r673962910



##########
File path: 
nifi-nar-bundles/nifi-azure-bundle/nifi-azure-processors/src/main/java/org/apache/nifi/processors/azure/storage/PutAzureDataLakeStorage.java
##########
@@ -192,4 +211,29 @@ static void uploadContent(DataLakeFileClient fileClient, 
InputStream in, long le
 
         fileClient.flush(length);
     }
+
+    private DataLakeFileClient renameFile(String fileName, String 
directoryPath, DataLakeFileClient fileClient, boolean overwrite) {
+        try {
+            final DataLakeRequestConditions destinationCondition = new 
DataLakeRequestConditions();
+            if (!overwrite) {
+                destinationCondition.setIfNoneMatch("*");
+            }
+            String destinationPath = StringUtils.isNotEmpty(directoryPath)
+                    ? directoryPath + "/" + fileName
+                    : fileName;
+            return fileClient.renameWithResponse(null, destinationPath, null, 
destinationCondition, null, null).getValue();
+        } catch (DataLakeStorageException dataLakeStorageException) {
+            getLogger().error("Error while renaming temp file on Azure Data 
Lake Storage", dataLakeStorageException);

Review comment:
       @MuazmaZ thanks for your help, temp file will remain on the server and 
will be overwritten at next try.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to