Class PatchApplier

java.lang.Object
org.machanism.machai.gw.tools.PatchApplier

public class PatchApplier extends Object
Utility to apply unified diff patches to text files.
  • Constructor Details

    • PatchApplier

      public PatchApplier()
  • Method Details

    • applyPatch

      public static void applyPatch(String filePath, List<String> patchLines, Charset charset) throws IOException
      Applies a unified diff patch to a file.
      Parameters:
      filePath - Path to the original file.
      patchLines - List of lines from the patch file.
      charset - Charset for reading/writing the file.
      Throws:
      IOException - if file operations fail or patch cannot be applied.