|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.cloudbees.diff.provider.DiffProvider
com.cloudbees.diff.provider.CmdlineDiffProvider
public class CmdlineDiffProvider
The parser of an external diff utility compatible with Unix diff output.
The implementtaion is interruptible by Thread.interrupt(). On interrupt it kills external program and throws InterruptedIOException,
| Field Summary | |
|---|---|
static String |
DIFF_REGEXP
|
| Constructor Summary | |
|---|---|
CmdlineDiffProvider(String diffCmd)
Creates new CmdlineDiffProvider |
|
| Method Summary | |
|---|---|
Diff |
computeDiff(Reader r1,
Reader r2)
Create the differences of the content two streams. |
static CmdlineDiffProvider |
createDefault()
|
String |
getDiffCommand()
Get the diff command being used. |
static void |
outputLine(String elements,
Pattern pattern,
List<Difference> differences,
StringBuffer firstText,
StringBuffer secondText)
This method is called, with elements of the output data. |
void |
setDiffCommand(String diffCmd)
Set a new diff command. |
static void |
setTextOnLastDifference(List<Difference> differences,
StringBuffer firstText,
StringBuffer secondText)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String DIFF_REGEXP
| Constructor Detail |
|---|
public CmdlineDiffProvider(String diffCmd)
diffCmd - The diff command. Must contain "{0}" and "{1}", which
will be replaced with the files being compared.| Method Detail |
|---|
public static CmdlineDiffProvider createDefault()
public void setDiffCommand(String diffCmd)
diffCmd - The diff command. Must contain "{0}" and "{1}", which
will be replaced with the files being compared.public String getDiffCommand()
public Diff computeDiff(Reader r1,
Reader r2)
throws IOException
computeDiff in class DiffProviderr1 - the first sourcer2 - the second source to be compared with the first one.
Difference;
or null when some error occured.
IOException - when the reading from input streams fails.
public static void setTextOnLastDifference(List<Difference> differences,
StringBuffer firstText,
StringBuffer secondText)
public static void outputLine(String elements,
Pattern pattern,
List<Difference> differences,
StringBuffer firstText,
StringBuffer secondText)
elements - the elements of output data.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||