Skip to content

Commit

Permalink
testing fix for windows modified date
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianKirmaier committed Dec 9, 2024
1 parent 16e3921 commit bb76cd9
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import java.awt.image.BufferedImage;
import java.io.File;
import java.nio.file.StandardCopyOption;
import java.nio.file.attribute.FileTime;
import java.time.Instant;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CountDownLatch;

Expand Down Expand Up @@ -93,8 +95,12 @@ void testImageRecreateOnChange() throws IOException {

var image1 = manager.loadImage(imageDef2);
String hash1 = imageDef2.getHashString();
System.out.println("ModifiedDate1: " + imageDef2File.lastModified());

Files.copy(file2.toPath(), imageDef2File.toPath(), StandardCopyOption.REPLACE_EXISTING);
System.out.println("ModifiedDate2: " + imageDef2File.lastModified());
Files.setLastModifiedTime(imageDef2File.toPath(), FileTime.from(Instant.now()));
System.out.println("ModifiedDate3: " + imageDef2File.lastModified());

var image2 = manager.loadImage(imageDef2);
String hash2 = imageDef2.getHashString();
Expand Down

0 comments on commit bb76cd9

Please sign in to comment.