public static void setModifiedTime(Path filePath, long modifiedTime) throws IOException {

    if (!Files.exists(filePath)) {
      return;
    }

    FileTime fileTime = FileTime.fromMillis(modifiedTime);

    Files.setLastModifiedTime(filePath, fileTime);
  }
Exemple #2
0
 /** Sets the last modified time for the given path. */
 public Path setLastModifiedTime(Path pathRelativeToProjectRoot, FileTime time)
     throws IOException {
   Path path = getPathForRelativePath(pathRelativeToProjectRoot);
   return Files.setLastModifiedTime(path, time);
 }