Troubleshooting
Problem
The lastModified() method of File API provides only seconds precision whereas the API documentation claims that this method returns precision up to nanosecond.
Symptom
File adapters use the lastModified() method of java.io.File API to sort files by timestamp. However, this method returns only second precision for a file's last modified timestamp on UNIX. This is a limitation with all versions of JDK up to version 1.6.
The limitation has been documented at the following link: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6939260
Resolving The Problem
There is currently no resolution within JDK for this limitation. To workaround this limitation, use the alternate approach that is provided by the adapter, which is to sort files by the file name.
Was this topic helpful?
Document Information
Modified date:
15 June 2018
UID
swg21446506