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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]