获取文件元数据
import java.io.IOException;/* from N o w J a v a . c o m - 时 代 Java*/ import java.nio.file.*; import java.nio.file.attribute.BasicFileAttributeView; import java.util.Set; public class Metadata { public static void main(String[] args) { FileSystem fs = FileSystems.getDefault(); Set<String> views = fs.supportedFileAttributeViews(); for (String view : views) { System.out.println(view); } for (FileStore store : fs.getFileStores()) { boolean supported = store .supportsFileAttributeView(BasicFileAttributeView.class); System.out.println(supported);/** 来 自 n o w j a v a . c o m**/ } Path path = Paths.get("CP1", "test.txt"); try { FileStore store = Files.getFileStore(path); boolean supported = store.supportsFileAttributeV