Code example for PosixFileAttributeView

Methods: setPermissions

            if (file.isDirectory()) {
            return true; 
        AclFileAttributeView aclView = Files.getFileAttributeView(
                fileP, AclFileAttributeView.class);
        if (aclView != null) {
            // Since we have an AclFileAttributeView which is not a 
            // PosixFileAttributeView, we probably have an NTFS file 
            // system. 
            // Remove existing ACEs, build a new one which simply 
            // gives all possible permissions to current owner. 
Connect your IDE to all the code out there  Get Codota for Java