You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2020/08/07 16:31:12 UTC

[commons-io] branch master updated: Don't call File.lastModified() directly but go through wrapper method to allow experimenting with Files.getLastModifiedTime().

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-io.git


The following commit(s) were added to refs/heads/master by this push:
     new e206649  Don't call File.lastModified() directly but go through wrapper method to allow experimenting with Files.getLastModifiedTime().
e206649 is described below

commit e2066491ac6c42c99dba127bb3cac38d9c3db7e8
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Fri Aug 7 12:31:05 2020 -0400

    Don't call File.lastModified() directly but go through wrapper method to
    allow experimenting with Files.getLastModifiedTime().
---
 src/test/java/org/apache/commons/io/FileUtilsTestCase.java | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/test/java/org/apache/commons/io/FileUtilsTestCase.java b/src/test/java/org/apache/commons/io/FileUtilsTestCase.java
index c462382..9c81611 100644
--- a/src/test/java/org/apache/commons/io/FileUtilsTestCase.java
+++ b/src/test/java/org/apache/commons/io/FileUtilsTestCase.java
@@ -1158,7 +1158,7 @@ public class FileUtilsTestCase {
         FileUtils.copyFile(testFile1, destination);
         assertTrue(destination.exists(), "Check Exist");
         assertEquals(testFile1Size, destination.length(), "Check Full copy");
-        assertEquals(testFile1.lastModified(), getLastModifiedMillis(destination), "Check last modified date preserved");
+        assertEquals(getLastModifiedMillis(testFile1), getLastModifiedMillis(destination), "Check last modified date preserved");
     }
 
     @Test
@@ -1206,7 +1206,7 @@ public class FileUtilsTestCase {
         FileUtils.copyFile(testFile1, destination);
         assertTrue(destination.exists(), "Check Exist");
         assertEquals(testFile2Size, destination.length(), "Check Full copy");
-        assertEquals(testFile1.lastModified() , getLastModifiedMillis(destination), "Check last modified date preserved");
+        assertEquals(getLastModifiedMillis(testFile1) , getLastModifiedMillis(destination), "Check last modified date preserved");
     }
 
     @Test
@@ -1409,9 +1409,9 @@ public class FileUtilsTestCase {
 
         // Test with preserveFileDate disabled
         FileUtils.copyDirectory(source, target, false);
-        assertNotEquals(DATE1, target.lastModified());
-        assertNotEquals(DATE2, targetDirectory.lastModified());
-        assertNotEquals(DATE3, targetFile.lastModified());
+        assertNotEquals(DATE1, getLastModifiedMillis(target));
+        assertNotEquals(DATE2, getLastModifiedMillis(targetDirectory));
+        assertNotEquals(DATE3, getLastModifiedMillis(targetFile));
         FileUtils.deleteDirectory(target);
 
         // Test with preserveFileDate enabled