@Override
    protected void initTask() {
        super.initTask();
        timeOffset = taskProfile.get(TaskConstants.TASK_FILE_TIME_OFFSET, "");
        retry = taskProfile.isRetry();
        originPatterns = Stream.of(taskProfile.get(TaskConstants.FILE_DIR_FILTER_PATTERNS).split(","))
                .collect(Collectors.toSet());
        if (taskProfile.getCycleUnit().compareToIgnoreCase(CycleUnitType.REAL_TIME) == 0) {
            realTime = true;
        }
        if (retry) {
            initRetryTask(taskProfile);
        } else {
            watchInit();
        }
    }
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