initializer-generator/src/main/java/com/alibaba/initializer/generation/extension/SampleCodeContributor.java [280:304]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    protected Path reslovePackagePath(Path sourceRoot, String content) {
        Path path = sourceRoot;
        Matcher matcher = Pattern.compile(PACKAGE_PATTEN).matcher(content);
        if (matcher.find()) {
            String pkg = matcher.group(1);
            for (String s : pkg.split("\\.")) {
                path = path.resolve(s);
            }
        }

        return path;
    }

    protected void doWirte(Path filePath, String content, boolean append) throws IOException {
        Path folderPath = filePath.getParent();
        Files.createDirectories(folderPath);

        File file = filePath.toFile();

        if (!append || !file.exists()) {
            Files.writeString(filePath, content);
        } else {
            FileCopyUtils.copy(
                    new ByteArrayInputStream(content.getBytes(StandardCharsets.UTF_8)),
                    Files.newOutputStream(filePath, StandardOpenOption.APPEND));
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



initializer-generator/src/main/java/org/apache/dubbo/initializer/generation/extension/codes/sample/ProtoBufCodeContributor.java [208:232]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    protected Path reslovePackagePath(Path sourceRoot, String content) {
        Path path = sourceRoot;
        Matcher matcher = Pattern.compile(PACKAGE_PATTEN).matcher(content);
        if (matcher.find()) {
            String pkg = matcher.group(1);
            for (String s : pkg.split("\\.")) {
                path = path.resolve(s);
            }
        }

        return path;
    }

    protected void doWirte(Path filePath, String content, boolean append) throws IOException {
        Path folderPath = filePath.getParent();
        Files.createDirectories(folderPath);

        File file = filePath.toFile();

        if (!append || !file.exists()) {
            Files.writeString(filePath, content);
        } else {
            FileCopyUtils.copy(
                    new ByteArrayInputStream(content.getBytes(StandardCharsets.UTF_8)),
                    Files.newOutputStream(filePath, StandardOpenOption.APPEND));
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



