914 |
914 |
915 /** |
915 /** |
916 * Returns the time that the file denoted by this abstract pathname was |
916 * Returns the time that the file denoted by this abstract pathname was |
917 * last modified. |
917 * last modified. |
918 * |
918 * |
|
919 * @apiNote |
|
920 * While the unit of time of the return value is milliseconds, the |
|
921 * granularity of the value depends on the underlying file system and may |
|
922 * be larger. For example, some file systems use time stamps in units of |
|
923 * seconds. |
|
924 * |
919 * <p> Where it is required to distinguish an I/O exception from the case |
925 * <p> Where it is required to distinguish an I/O exception from the case |
920 * where {@code 0L} is returned, or where several attributes of the |
926 * where {@code 0L} is returned, or where several attributes of the |
921 * same file are required at the same time, or where the time of last |
927 * same file are required at the same time, or where the time of last |
922 * access or the creation time are required, then the {@link |
928 * access or the creation time are required, then the {@link |
923 * java.nio.file.Files#readAttributes(Path,Class,LinkOption[]) |
929 * java.nio.file.Files#readAttributes(Path,Class,LinkOption[]) |
924 * Files.readAttributes} method may be used. |
930 * Files.readAttributes} method may be used. If however only the |
925 * |
931 * time of last modification is required, then the |
926 * @apiNote |
932 * {@link java.nio.file.Files#getLastModifiedTime(Path,LinkOption[]) |
927 * While the unit of time of the return value is milliseconds, |
933 * Files.getLastModifiedTime} method may be used instead. |
928 * the granularity of the value depends on the underlying |
|
929 * file system and may be larger. For example, some |
|
930 * file systems use time stamps in units of seconds. |
|
931 * |
934 * |
932 * @return A <code>long</code> value representing the time the file was |
935 * @return A <code>long</code> value representing the time the file was |
933 * last modified, measured in milliseconds since the epoch |
936 * last modified, measured in milliseconds since the epoch |
934 * (00:00:00 GMT, January 1, 1970), or <code>0L</code> if the |
937 * (00:00:00 GMT, January 1, 1970), or <code>0L</code> if the |
935 * file does not exist or if an I/O error occurs |
938 * file does not exist or if an I/O error occurs. The value may |
|
939 * be negative indicating the number of milliseconds before the |
|
940 * epoch |
936 * |
941 * |
937 * @throws SecurityException |
942 * @throws SecurityException |
938 * If a security manager exists and its {@link |
943 * If a security manager exists and its {@link |
939 * java.lang.SecurityManager#checkRead(java.lang.String)} |
944 * java.lang.SecurityManager#checkRead(java.lang.String)} |
940 * method denies read access to the file |
945 * method denies read access to the file |