package newpackage3;
/**
*
* @author rajani
*/
import java.io.File;
import org.apache.commons.io.FileUtils;
public class compareFileContent
{
public static void main(String[] args) throws Exception
{
/* Get the files to be compared first */
File file1 = new File("temp.txt");
File file2 = new File("amazon.txt");
File file3 = new File("amazoncomp.txt");
boolean compareResult = FileUtils.contentEquals(file1, file2);
boolean compp=FileUtils.contentEquals(file1,file3);
if(compareResult==true)
{
System.out.println("amazon file");
}
if(compp==true)
{
System.out.println("amazoncomp file");
}
}
}
/**
*
* @author rajani
*/
import java.io.File;
import org.apache.commons.io.FileUtils;
public class compareFileContent
{
public static void main(String[] args) throws Exception
{
/* Get the files to be compared first */
File file1 = new File("temp.txt");
File file2 = new File("amazon.txt");
File file3 = new File("amazoncomp.txt");
boolean compareResult = FileUtils.contentEquals(file1, file2);
boolean compp=FileUtils.contentEquals(file1,file3);
if(compareResult==true)
{
System.out.println("amazon file");
}
if(compp==true)
{
System.out.println("amazoncomp file");
}
}
}
No comments:
Post a Comment