@Override
    protected void scanExistingFile() {
        originPatterns.forEach((originPattern) -> {
            List<BasicFileInfo> fileInfos = scanExistingFileByPattern(originPattern);
            LOGGER.info("taskId {} scan {} get file count {}", getTaskId(), originPattern, fileInfos.size());
            fileInfos.forEach((fileInfo) -> {
                String fileName = fileInfo.fileName;
                Long fileUpdateTime = FileUtils.getFileLastModifyTime(fileName);
                addToEvenMap(fileName, fileInfo.dataTime, fileUpdateTime, taskProfile.getCycleUnit());
                if (retry) {
                    instanceCount++;
                }
            });
        });
    }
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