Java Utililty Methods Is File Newer

List of utility methods to do Is File Newer

Description

The list of methods to do Is File Newer are organized into topic(s).

Method

booleanisNewer(File file, File reference)
PerformTest if specified File is newer than the reference File.
if (reference.exists() == false) {
    throw new IllegalArgumentException("The reference file '" + file + "' doesn't exist");
return isNewer(file, reference.lastModified());
BooleanisNewer(File file1, File file2)
This will check to see if file1 is newer than file2.
if (file1 == null || file2 == null) {
    return null;
if (!file1.isFile() || !file2.isFile()) {
    return null;
long file1Date = file1.lastModified();
long file2Date = file2.lastModified();
...
booleanisNewer(String file, String reference)
is Newer
return isNewer(new File(file), new File(reference));
booleanisNewerOrEqual(String newFile, String oldFile)
is Newer Or Equal
File newF = new File(newFile);
File oldF = new File(oldFile);
if (!newF.exists())
    return false;
if (!oldF.exists())
    return true;
return newF.lastModified() >= oldF.lastModified();