List of utility methods to do Is File Newer
boolean | isNewer(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()); |
Boolean | isNewer(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(); ... |
boolean | isNewer(String file, String reference) is Newer return isNewer(new File(file), new File(reference)); |
boolean | isNewerOrEqual(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(); |