Email : [email protected]
Updates any or all timestamps for the file’s last modified time, last access time, and creation time attributes. If any parameter has the value null, the corresponding timestamp is not changed. Note that apart from the Files.setLast-Modified() method, there are no methods in the Files class for the last access and creation times for a directory entry.
The code below obtains a BasicFileAttributeView object at (6) that pertains to the file denoted by the path reference. A BasicFileAttributes object is obtained at (7), providing read-only access to the basic file attributes, whose values are printed by calling the printBasicFileAttributes() method. The last modified time of the directory entry is explicitly read by calling the lastModifiedTime() method of the BasicFileAttributes object.