private void handleFilePath(Path filePath, WatchEntity entity) {
        String newFileName = filePath.toFile().getAbsolutePath();
        LOGGER.info("new file {} {}", newFileName, entity.getPattern());
        Matcher matcher = entity.getPattern().matcher(newFileName);
        if (matcher.matches() || matcher.lookingAt()) {
            LOGGER.info("matched file {} {}", newFileName, entity.getPattern());
            String dataTime = getDataTimeFromFileName(newFileName, entity.getDateExpression());
            if (!checkFileNameForTime(newFileName, entity)) {
                LOGGER.error("File Timeout {} {}", newFileName, dataTime);
                return;
            }
            Long fileUpdateTime = FileUtils.getFileLastModifyTime(newFileName);
            addToEvenMap(newFileName, dataTime, fileUpdateTime, taskProfile.getCycleUnit());
        }
    }
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