public ImmutableMap < Name , Long > snapshotModifiedTimes ( JimfsPath path ) throws IOException { ImmutableMap . Builder < Name , Long > modifiedTimes = ImmutableMap . builder ( ) ; store . readLock ( ) . lock ( ) ; try { Directory dir = ( Directory ) lookUp ( path , Options . FOLLOW_LINKS ) . requireDirectory ( path ) . file ( ) ; // TODO(cgdecker): Investigate whether WatchServices should keep a reference to the actual // directory when SecureDirectoryStream is supported rather than looking up the directory // each time the WatchService polls for ( DirectoryEntry entry : dir ) { if ( ! entry . name ( ) . equals ( Name . SELF ) && ! entry . name ( ) . equals ( Name . PARENT ) ) { modifiedTimes . put ( entry . name ( ) , entry . file ( ) . getLastModifiedTime ( ) ) ; } } return modifiedTimes . build ( ) ; } finally { store . readLock ( ) . unlock ( ) ; } }
Returns a snapshot mapping the names of each file in the directory at the given path to the last modified time of that file .