开发者

Collect metadata from file java [duplicate]

开发者 https://www.devze.com 2023-02-21 17:12 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicate: Getting the last modified date of a file in Java
This question already has answers here: Closed 11 years ago.

Possible Duplicate:

Getting the last modified date of a file in Java

Is the开发者_如何学Pythonre a way to get file metadata like "date modified" in java?


The java.io.File class has several methods that could be of interest to you, e.g. lastModified().


java.io.File#lastModified().

File f = new File(...);
if (f.exists())
{
    System.out.println(new Date(f.lastModified()));
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号