检查用户定义的属性可支持性
//来自 时 代 J a v a 公 众 号 import java.io.IOException; import java.nio.file.FileStore; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.attribute.UserDefinedFileAttributeView; public class Main { public static void main(String[] args) { Path path = Paths.get("C:/folder1/folder2/folder4", "test.txt"); try { FileStore store = Files.getFileStore(path);/** nowjava - 时 代 Java 提供 **/ if (!store.supportsFileAttributeView(UserDefinedFileAttributeView.class)) { System.out.println("The user defined attributes are not supported on: " + store); } else { System.out.prin