Class XWikiPatchUtils


  • public class XWikiPatchUtils
    extends Object
    Diff and patch utility.
    Since:
    1.2M1
    Version:
    $Id: 72e3426860aaf2383f3ecf446ceda2338ddede2d $
    • Method Detail

      • getDiff

        public static String getDiff​(Object[] orig,
                                     Object[] rev)
                              throws org.suigeneris.jrcs.diff.DifferentiationFailedException
        Parameters:
        orig - - original text
        rev - - new text
        Returns:
        diff in JRCS format
        Throws:
        org.suigeneris.jrcs.diff.DifferentiationFailedException - if error when creating diff
      • getDiff

        public static String getDiff​(String orig,
                                     String rev)
                              throws org.suigeneris.jrcs.diff.DifferentiationFailedException
        Parameters:
        orig - - original text
        rev - - new text
        Returns:
        diff in JRCS format
        Throws:
        org.suigeneris.jrcs.diff.DifferentiationFailedException - if error when creating diff
      • patch

        public static void patch​(List<String> orig,
                                 String diff)
                          throws org.suigeneris.jrcs.rcs.InvalidFileFormatException,
                                 org.suigeneris.jrcs.diff.PatchFailedException
        From Node.patch(List, boolean).
        Parameters:
        orig - - text to patch, List<String> of lines.
        diff - - diff to patch, Diff format
        Throws:
        org.suigeneris.jrcs.rcs.InvalidFileFormatException - if diff is incorrect
        org.suigeneris.jrcs.diff.PatchFailedException - if error in patching