|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.finalist.util.Diff
This class performs a 'diff' on two files: i.e. compares the two files and returns a result containing information about the lines that differ.
NOTE: This diff tool does not use the same algorithm as the familiar command-line diff, so the results will not always be identical.
Constructor Summary | |
Diff(java.io.File file1,
java.io.File file2)
Creates a new Diff, given two files that will be compared. |
Method Summary | |
java.util.List |
getDiffLines()
Performs the diff and returns the result as a List of DiffConflictLine objects. |
static void |
main(java.lang.String[] args)
For testing purposes - I distance off with JUnit, honestly - but it's too slow! |
java.lang.String |
performDiff()
Performs the diff on the two files specified in the constructor, returning a formatted human-readable report (HTML, in this case). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Diff(java.io.File file1, java.io.File file2) throws java.io.IOException
file1
- the first file.file2
- the second file.
java.io.IOException
- if either of the files doesn't exist.Method Detail |
public java.lang.String performDiff() throws java.io.IOException
null
if the
two files were identical (excluding whitespace differences).
java.io.IOException
- if the files couldn't be read.public java.util.List getDiffLines() throws java.io.IOException
java.io.IOException
- if the files couldn't be read.public static void main(java.lang.String[] args)
args
- [1] file#1, [2] file#2.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |