public class CmdlineDiffProvider extends DiffProvider implements Serializable
The implementtaion is interruptible by Thread.interrupt(). On interrupt it kills external program and throws InterruptedIOException,
| Modifier and Type | Field and Description |
|---|---|
static String |
DIFF_REGEXP |
| Constructor and Description |
|---|
CmdlineDiffProvider(String diffCmd)
Creates new CmdlineDiffProvider
|
| Modifier and Type | Method and Description |
|---|---|
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) |
public static final String DIFF_REGEXP
public CmdlineDiffProvider(String diffCmd)
diffCmd - The diff command. Must contain "{0}" and "{1}", which
will be replaced with the files being compared.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.Copyright © 2011–2019. All rights reserved.