Java Path File Time nio getLastModifiedTimeInMillis(Path path)

Here you can find the source of getLastModifiedTimeInMillis(Path path)

Description

Returns a file's last modified time in milliseconds.

License

Open Source License

Parameter

Parameter Description
path the path to the file.

Exception

Parameter Description
IOException if something goes wrong.

Return

the last modified time in milliseconds.

Declaration

public static long getLastModifiedTimeInMillis(Path path) throws IOException 

Method Source Code


//package com.java2s;
import java.io.IOException;

import java.nio.file.*;

public class Main {
    /**/* w ww. ja  v a 2 s . co  m*/
     * Returns a file's last modified time in milliseconds.
     *
     * @param path the path to the file.
     * @return the last modified time in milliseconds.
     * @throws IOException if something goes wrong.
     */
    public static long getLastModifiedTimeInMillis(Path path) throws IOException {
        return Files.getLastModifiedTime(path).toMillis();
    }
}

Related

  1. awaitLogMessage(String message, long timeout, Path logFilePath)
  2. fileCreationTime(Path path)
  3. getLastAccessTime(Path file)
  4. getLastModificationTime(Path path)
  5. getLastModifiedTime(Path path)
  6. getMTime(Path path)
  7. setFileTimes(String path, Date creationTime, Date lastAccessTime, Date lastModifiedTime)
  8. setTimes(Path path, Date time)