public class TimeUtil
extends java.lang.Object
Constructor and Description |
---|
TimeUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
setLastModifiedOf(java.nio.file.Path a,
java.nio.file.Path b)
Set the lastModified time of file a to the one from file b
|
static java.time.Instant |
setLastModifiedWithOffset(java.nio.file.Path path,
long offsetMillis)
Set the lastModified time of a given file by adding a given offset to the
current lastModified time
|
public static java.time.Instant setLastModifiedWithOffset(java.nio.file.Path path, long offsetMillis)
path
- path of a file to set last modifiedoffsetMillis
- offset in milliseconds, if negative the new lastModified time
is offset before the original lastModified time, otherwise
after the original timepublic static void setLastModifiedOf(java.nio.file.Path a, java.nio.file.Path b)
a
- file to set lastModified timeb
- file to read lastModified time from