开发者

Collect metadata from file java [duplicate]

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜