com.xpn.xwiki.doc.rcs
Class XWikiPatchUtils
java.lang.Object
com.xpn.xwiki.doc.rcs.XWikiPatchUtils
public class XWikiPatchUtils
- extends Object
diff & patch utility.
- Since:
- 1.2M1
- Version:
- $Id: 54f86c1badf27bc4ff138c21e9aca8ae76ecf4ac $
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
- 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
Copyright © 2004–2014 XWiki. All rights reserved.