Collect metadata from file java [duplicate]
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()));
}
精彩评论