Package com.xpn.xwiki.doc.rcs
Class XWikiPatchUtils
- java.lang.Object
-
- com.xpn.xwiki.doc.rcs.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 textrev
- - 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 textrev
- - 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
FromNode.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 incorrectorg.suigeneris.jrcs.diff.PatchFailedException
- if error in patching
-
-