zhuzhurk commented on a change in pull request #9950: [FLINK-14464][runtime]
Introduce the AbstractUserClassPathJobGraphRetriever
URL: https://github.com/apache/flink/pull/9950#discussion_r339283097
##########
File path: flink-core/src/main/java/org/apache/flink/util/FileUtils.java
##########
@@ -525,6 +540,102 @@ public static Path expandDirectory(Path file, Path
targetDirectory) throws IOExc
return new Path(targetDirectory, rootDir);
}
+ /**
+ * List the directory {@code directory} recursively and return the
files that satisfies the {@code fileFilter}.
+ *
+ * @param directory the directory to be listed
+ * @param fileFilter a file filter
+ * @return a collection of {@code File}s
+ *
+ * @throws IOException if an I/O error occurs while listing the files
in the given directory
+ */
+ public static Collection<File> listFilesInPath(@Nonnull final File
directory, @Nonnull final Predicate<File> fileFilter) throws IOException {
Review comment:
I think we do not need the @Nonnull annotation since a param is supposed to
be non-null by default.
Instead, we should do null checks before using these params.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services