bhattmanish98 commented on code in PR #7496:
URL: https://github.com/apache/hadoop/pull/7496#discussion_r2021067903


##########
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsBlobClient.java:
##########
@@ -1528,10 +1528,31 @@ public AbfsRestOperation deleteBlobPath(final Path 
blobPath,
    */
   @Override
   public boolean checkIsDir(AbfsHttpOperation result) {
-    String resourceType = result.getResponseHeader(X_MS_META_HDI_ISFOLDER);
+    String dirHeaderName = getHeaderNameIgnoreCase(result, 
X_MS_META_HDI_ISFOLDER);
+    // If the header is not found, return false (not a directory)
+    if (dirHeaderName == null) {
+      return false;
+    }
+
+    String resourceType = result.getResponseHeader(dirHeaderName);
     return resourceType != null && resourceType.equals(TRUE);

Review Comment:
   In the case of an empty string, resourceType.equals(TRUE) will return false, 
so there’s no need for an explicit check for an empty string.
   The null case occurs when the header we are looking for does not exist, 
which is why this check is needed.



-- 
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: common-issues-unsubscr...@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to