public void saveToLocalFile(String confPath) {
        File temp = new File(confPath);
        if (!temp.exists()) {
            temp.mkdirs();
        }
        File jsonPath = new File(temp.getPath() + "/" + LOCAL_CONFIG_FILE);
        try (BufferedWriter writer = new BufferedWriter(
                new OutputStreamWriter(new FileOutputStream(jsonPath), StandardCharsets.UTF_8))) {
            String curConfig = GSON.toJson(ConfigResult.builder().md5(currentMd5).version(currentVersion)
                    .moduleList(currentModules.values().stream().collect(Collectors.toList())).build());
            writer.write(curConfig);
            writer.flush();
            LOGGER.info("save modules to json file");
        } catch (IOException e) {
            LOGGER.error("saveToLocalFile error: ", e);
        }
    }
Thread for core thread.

@return runnable profile.
inlong-agent/agent-installer/src/main/java/org/apache/inlong/agent/installer/ModuleManager.java