com.xpn.xwiki.doc.rcs
Class XWikiPatchUtils

java.lang.Object
  extended by com.xpn.xwiki.doc.rcs.XWikiPatchUtils

public class XWikiPatchUtils
extends Object

diff & patch utility.

Since:
1.2M1
Version:
$Id: 54f86c1badf27bc4ff138c21e9aca8ae76ecf4ac $

Method Summary
static String getDiff(Object[] orig, Object[] rev)
           
static String getDiff(String orig, String rev)
           
static void patch(List<String> orig, String diff)
          From Node#patch(List, boolean).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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


Copyright © 2004-2013 XWiki. All Rights Reserved.