public FileFinder containingFile(final Predicate<File> fileInDir) {
        return withFileFilter(new Predicate<File>() {

            public boolean apply(File directory) {
                return directoryContainsFile(directory, fileInDir);
            }
        });
    }
Accepts a custom filter to search for specific files or directories. All files that match the
{@link Predicate} (and match the yield* file type) will be returned in the result.
<p/>
Multiple calls of {@link #withFileFilter(Predicate)} as well as other filter methods like
{@link #withName(String)} will be combined with an AND condition, i.e. all filters have to
match.

@param filter The {@link Predicate} that should be used to filter files.
@return The current {@link FileFinder} to perform method chaining.
inlong-agent/agent-common/src/main/java/org/apache/inlong/agent/utils/file/FileFinder.java