yangys
2025-09-13 083df8d788c95c009a94378e620684eb5de2bd21
blade-service/blade-mdm/src/main/java/org/springblade/mdm/utils/FileContentUtil.java
@@ -159,10 +159,10 @@
   /**
    * 替换文件中的某一行
    * @param ins 输入流
    * @param repalceWith 替换后的文本
    * @param replaceWith 替换的文本
    * @param lineIndex 行索引 0 based
    */
    public static InputStream replaceAtLine(InputStream ins, int lineIndex,String repalceWith) throws IOException {
    public static InputStream replaceAtLine(InputStream ins, int lineIndex,String replaceWith) throws IOException {
      byte[] bytes = ins.readAllBytes();
      ByteArrayInputStream byteStream = new ByteArrayInputStream(bytes);
      Charset charset = Charsets.charset(detectFromInputStream(byteStream));
@@ -180,7 +180,7 @@
         while ((line = reader.readLine()) != null) {
            // 如果是目标行,写入新内容
            if (currentLine == lineIndex) {
               writer.write(repalceWith);
               writer.write(replaceWith);
            } else {
               writer.write(line);
            }