- 定义路径
Path path = Paths.get("E:/1.sql");
- 获取文件存储,并检查
try { FileStore store = Files.getFileStore(path); if (store.supportsFileAttributeView(UserDefinedFileAttributeView.class)) { System.out.println("The user defined attributes are supported on: " + store); } else { System.out.println("The user defined attributes are not supported on: " + store); } } catch (Exception e) { e.printStackTrace(); }