import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Map;
public class Main {
public static void main(String[] args) throws IOException {
// Get a Path object
Path path = Paths.get("Main.java");
// Prepare the attribute list
String attribList = "basic:size,lastModifiedTime";
// Read the attributes
Map<String, Object> attribs = Files.readAttributes(path, attribList);
// Display the attributes on the standard output
System.out.println(attribs.get("size"));
System.out.println(attribs.get("lastModifiedTime"));
}/*from ww w.j a v a 2 s . com*/
}