tillrohrmann commented on a change in pull request #9950: [FLINK-14464][runtime] Introduce the AbstractUserClassPathJobGraphRetriever URL: https://github.com/apache/flink/pull/9950#discussion_r341156074
########## File path: flink-core/src/main/java/org/apache/flink/util/FileUtils.java ########## @@ -525,6 +540,123 @@ public static Path expandDirectory(Path file, Path targetDirectory) throws IOExc return new Path(targetDirectory, rootDir); } + /** + * List the {@code directory} recursively and return the files that satisfy 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(final File directory, final Predicate<File> fileFilter) throws IOException { + checkNotNull(directory, "directory"); + checkNotNull(fileFilter, "fileFilter"); + + if (!Files.exists(directory.toPath())) { Review comment: Given that we always convert `File` to `nio.file.Path`, I think we could change the signature to accept `nio.file.Path` and return a collection of `nio.file.Path`. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services