If the underlying file system is a Windows-based file system, force() will set the last modification date to the date of the last byte written.
force() is called by close(), i.e. setting the last modified date in between of opening and closing a file will not have any effect, because force() overwrites any previous changes:
try (FileChannel ch = FileChannel.open(file, CREATE_NEW, WRITE)) {
Files.setLastModifiedTime(file, time); // set lastModifiedTime to time
} // during close: set lastModifiedTime to time at which last byte was written to ciphertext channel
If the underlying file system is a Windows-based file system,
force()
will set the last modification date to the date of the last byte written.force()
is called byclose()
, i.e. setting the last modified date in between of opening and closing a file will not have any effect, becauseforce()
overwrites any previous changes:https://github.com/cryptomator/cryptofs/blob/2e57c6fd8bca5aeedcabd9cbc68bb594d7115acd/src/main/java/org/cryptomator/cryptofs/ch/CleartextFileChannel.java#L211-L213