public static Collection<File> findSuitFiles(TaskProfile jobConf) {
        Set<String> dirPatterns = Stream.of(
                jobConf.get(FILE_DIR_FILTER_PATTERNS).split(",")).collect(Collectors.toSet());
        LOGGER.info("start to find files with dir pattern {}", dirPatterns);

        Set<PathPattern> pathPatterns =
                PathPattern.buildPathPattern(dirPatterns, jobConf.get(TASK_FILE_TIME_OFFSET, null));
        updateRetryTime(jobConf, pathPatterns);
        int maxFileNum = DEFAULT_FILE_MAX_NUM;
        LOGGER.info("dir pattern {}, max file num {}", dirPatterns, maxFileNum);
        Collection<File> allFiles = new ArrayList<>();
        pathPatterns.forEach(pathPattern -> allFiles.addAll(pathPattern.walkSuitableFiles(maxFileNum)));
        return allFiles;
    }
scan and return files based on job dir conf
inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/utils/PluginUtils.java