Package org.eclipse.jgit.junit.time
Class TimeUtil
- java.lang.Object
-
- org.eclipse.jgit.junit.time.TimeUtil
-
public class TimeUtil extends Object
Utility methods for handling timestamps
-
-
Constructor Summary
Constructors Constructor Description TimeUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidsetLastModifiedOf(Path a, Path b)Set the lastModified time of file a to the one from file bstatic InstantsetLastModifiedWithOffset(Path path, long offsetMillis)Set the lastModified time of a given file by adding a given offset to the current lastModified time
-
-
-
Method Detail
-
setLastModifiedWithOffset
public static Instant setLastModifiedWithOffset(Path path, long offsetMillis)
Set the lastModified time of a given file by adding a given offset to the current lastModified time- Parameters:
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 time- Returns:
- the new lastModified time
-
-