The following posts might help
Java APIs for Text file comparison (Java in General forum at JavaRanch)

If you are on unix/linux, it has some standard command line tools you can use to do file...