Javaでファイルのプロパティを操作する

Javaコード:

public class FileIoTest {
public static void main(String[] args) throws IOException {

Path path = Paths.get(“D:\\Program Files\\Java");
BasicFileAttributes attr = Files.readAttributes(path, BasicFileAttributes.class);

System.out.println(“creationTime: " + attr.creationTime());
System.out.println(“lastAccessTime: " + attr.lastAccessTime());
System.out.println(“lastModifiedTime: " + attr.lastModifiedTime());

System.out.println(“isDirectory: " + attr.isDirectory());
System.out.println(“isOther: " + attr.isOther());
System.out.println(“isRegularFile: " + attr.isRegularFile());
System.out.println(“isSymbolicLink: " + attr.isSymbolicLink());
System.out.println(“size: " + attr.size());

}
}

Java

Posted by arkgame