Class TimeUtil

  • public class TimeUtil
    extends Object
    Utility methods for handling timestamps
    • Constructor Detail

      • TimeUtil

        public TimeUtil()
    • 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
        path - path of a file to set last modified
        offsetMillis - offset in milliseconds, if negative the new lastModified time is offset before the original lastModified time, otherwise after the original time
        the new lastModified time
      • setLastModifiedOf

        public static void setLastModifiedOf​(Path a,
                                             Path b)
        Set the lastModified time of file a to the one from file b
        a - file to set lastModified time
        b - file to read lastModified time from