cryptoe commented on code in PR #13269:
URL: https://github.com/apache/druid/pull/13269#discussion_r1017834549


##########
core/src/main/java/org/apache/druid/storage/local/LocalFileStorageConnector.java:
##########
@@ -107,6 +111,23 @@ public void deleteRecursively(String dirName) throws 
IOException
     FileUtils.deleteDirectory(fileWithBasePath(dirName));
   }
 
+  @Override
+  public List<String> listDir(String dirName)
+  {
+    File directory = fileWithBasePath(dirName);
+    if (!directory.exists()) {
+      throw new IAE("No directory exists on path [%s]", dirName);
+    }
+    if (!directory.isDirectory()) {
+      throw new IAE("Cannot list contents of [%s] since it is not a 
directory", dirName);
+    }
+    File[] files = directory.listFiles();
+    if (files == null) {

Review Comment:
   I think empty files should not return an exception but that can be done as 
part of a follow up PR



-- 
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: commits-unsubscr...@druid.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org
For additional commands, e-mail: commits-h...@druid.apache.org

Reply via email to