Package org.machanism.machai.gw.tools
Class PatchApplier
java.lang.Object
org.machanism.machai.gw.tools.PatchApplier
Utility to apply unified diff patches to text files.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidapplyPatch(String filePath, List<String> patchLines, Charset charset) Applies a unified diff patch to a file.
-
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.
-