public static void setModifiedTime(Path filePath, long modifiedTime) throws IOException { if (!Files.exists(filePath)) { return; } FileTime fileTime = FileTime.fromMillis(modifiedTime); Files.setLastModifiedTime(filePath, fileTime); }
/** 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); }