private static String readJsonFile(Path path) throws IOException {
        File configFile = path.toFile();
        if (!configFile.isFile() && !configFile.canRead()) {
            throw new IOException(String.format("json file[%s] invalid!", path));
        }
        String dir = configFile.getParent();
        String content;
        try (FileInputStream is = new FileInputStream(configFile)) {
            content = IOUtils.toString(is);
        }

        Matcher matcher = ExtendFlag.matcher(content);
        StringBuffer sb = new StringBuffer();
        while (matcher.find()) {
            String reg = matcher.group();
            String replaceFile = StringUtils.removeStart(StringUtils.strip(reg, "\"").trim(), "@extend:").trim();
            if (!replaceFile.startsWith("/") && dir != null) {
                replaceFile = dir + "/" + replaceFile;
            }
            String replaceJson = readJsonFile(Paths.get(replaceFile));
            matcher.appendReplacement(sb, replaceJson);
        }
        matcher.appendTail(sb);
        return sb.toString();
    }
This class should only be used in config loading or debug.
Don't use in high performance required scenario.
indexr-common/src/main/java/io/indexr/util/JsonUtil.java