public boolean suitable(String path) {
        // remove common root path
        String briefSubDir = StringUtils.substringAfter(path, rootDir);
        // if already watched, then stop deep find
        if (subDirs.contains(briefSubDir)) {
            LOGGER.info("already watched {}", path);
            return false;
        }

        subDirs.add(briefSubDir);
        File file = new File(path);
        return whiteList.stream()
                .filter(whiteRegex -> whiteRegex.match(file))
                .findAny()
                .isPresent();
    }
Check whether path is suitable for match whiteList and filtered by blackList

@param path pathString
@return true if suit else false.
inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/task/PathPattern.java