yuqi1129 commented on code in PR #7794:
URL: https://github.com/apache/gravitino/pull/7794#discussion_r2269505413


##########
clients/filesystem-hadoop3/src/main/java/org/apache/gravitino/filesystem/hadoop/DefaultGVFSOperations.java:
##########
@@ -60,6 +60,14 @@ public void close() throws IOException {
 
   @Override
   public FSDataInputStream open(Path gvfsPath, int bufferSize) throws 
IOException {
+    if (gvfsPath.toString().endsWith("/")) {
+      String message =
+          "Cannot open a directory path: "
+              + gvfsPath
+              + ". Please use listStatus or getFileStatus to access 
directory.";
+      throw new IOException(message);
+    }

Review Comment:
   It's hard to use raw string to identify whether it is a directory or not, 
and I will use `fs.getFileStatus().isDirectory` instead.



-- 
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