Class PatchUtils

java.lang.Object
org.netbeans.api.diff.PatchUtils

public class PatchUtils extends Object
Utility class for patch application.
Since:
1.19
  • Method Details

    • applyPatch

      public static void applyPatch(File patch, File context) throws IOException
      Applies the patch file on the context file or folder. The patch file may be in a context, normal or unified format.
      Parameters:
      patch - the patch file
      context - the file or folder to be updated with the patch
      Throws:
      org.netbeans.modules.diff.builtin.PatchException
      IOException - - the patch is invalid or cannot be applied
      Since:
      1.19
    • isPatch

      public static boolean isPatch(File patch) throws IOException
      Returns true only if the given file is a patch in a format recognizable as a
      • context
      • normal
      • unified
      Parameters:
      patch - patch file
      Returns:
      true if the given input stream is a patch otherwise false
      Throws:
      IOException
      Since:
      1.19