List of usage examples for java.nio.file SecureDirectoryStream getFileAttributeView
<V extends FileAttributeView> V getFileAttributeView(Class<V> type);
From source file:Test.java
public static void main(String args[]) throws IOException { Path path = Paths.get("home/docs"); SecureDirectoryStream<Path> sds = (SecureDirectoryStream) Files.newDirectoryStream(path); PosixFileAttributeView view = sds.getFileAttributeView(PosixFileAttributeView.class); PosixFileAttributes attributes = view.readAttributes(); Set<PosixFilePermission> permissions = attributes.permissions(); for (PosixFilePermission permission : permissions) { System.out.print(permission.toString() + ' '); }/* w ww . j a v a 2 s .c o m*/ }