You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by mb...@apache.org on 2025/03/18 14:09:45 UTC

(nifi) branch main updated: NIFI-14376 Fixed retrieving Shared Drive name in ListGoogleDrive

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

mbathori pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git


The following commit(s) were added to refs/heads/main by this push:
     new 05007f14d7 NIFI-14376 Fixed retrieving Shared Drive name in ListGoogleDrive
05007f14d7 is described below

commit 05007f14d7c938bc3c4af615cb58ceee17dfa652
Author: Peter Turcsanyi <tu...@apache.org>
AuthorDate: Tue Mar 18 09:44:56 2025 +0100

    NIFI-14376 Fixed retrieving Shared Drive name in ListGoogleDrive
    
    This closes #9808.
    
    Signed-off-by: Mark Bathori <mb...@apache.org>
---
 .../java/org/apache/nifi/processors/gcp/drive/ListGoogleDrive.java | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/nifi-extension-bundles/nifi-gcp-bundle/nifi-gcp-processors/src/main/java/org/apache/nifi/processors/gcp/drive/ListGoogleDrive.java b/nifi-extension-bundles/nifi-gcp-bundle/nifi-gcp-processors/src/main/java/org/apache/nifi/processors/gcp/drive/ListGoogleDrive.java
index 6a9dc0cc3a..8211f4e6ec 100644
--- a/nifi-extension-bundles/nifi-gcp-bundle/nifi-gcp-processors/src/main/java/org/apache/nifi/processors/gcp/drive/ListGoogleDrive.java
+++ b/nifi-extension-bundles/nifi-gcp-bundle/nifi-gcp-processors/src/main/java/org/apache/nifi/processors/gcp/drive/ListGoogleDrive.java
@@ -303,15 +303,16 @@ public class ListGoogleDrive extends AbstractListProcessor<GoogleDriveFileInfo>
                 .setFields("name, driveId")
                 .execute();
 
-        if (folder.getDriveId() == null) {
-            return folder.getName();
-        } else {
+        if (folderId.equals(folder.getDriveId())) {
+            // if folderId points to a Shared Drive root, files() returns "Drive" for the name and drives() needs to be used to get the real name
             return driveService
                     .drives()
                     .get(folderId)
                     .setFields("name")
                     .execute()
                     .getName();
+        } else {
+            return folder.getName();
         }
     }