private List<BasicFileInfo> scanExistingFileByPattern(String originPattern) {
        if (realTime) {
            return FileScanner.scanTaskBetweenTimes(originPattern, CycleUnitType.HOUR, timeOffset,
                    startTime, endTime, retry);
        } else {
            return FileScanner.scanTaskBetweenTimes(originPattern, taskProfile.getCycleUnit(),
                    timeOffset, startTime, endTime, retry);
        }
    }
Watch directory, if new valid files are created, create instance correspondingly.
inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/task/logcollection/local/FileTask.java