I know that using File object we can get the last modified time for a File. But, my requirement is to get the last accessed time for a file in Java. How do I get it?
+2
A:
You can't do it with plain Java, you'll need to use JNI to access the platform specific data, such as this.
Kris
2009-05-28 10:56:58
+4
A:
You will need to wait for NIO2, which should come with Java 7. It has a method lastAccessTime() for reading the last access time.
Esko Luontola
2009-05-28 11:02:22