One of the requirements in my project needs to check if the file's creation date and determine if it is older than 2 days from current day. In Java, there is something like below code which can get us the file's creation date and other information.
Path file = ...;
BasicFileAttributes attr = Files.readAttributes(file, BasicFileAttributes.class);
System.out.println("creationTime: " + attr.creationTime());
System.out.println("lastAccessTime: " + attr.lastAccessTime());
System.out.println("lastModifiedTime: " + attr.lastModifiedTime());
But I don't know how to write the same code in Scala. Could anyone let me know how the same can be implemented in Scala.