public static void removePermission(Path path,PosixFilePermission permission) throws IOException {
  Set<PosixFilePermission> perms=Files.getPosixFilePermissions(path);
  if (perms.remove(permission)) {
    Files.setPosixFilePermissions(path,perms);
  }
}

public static void removePermission ( Path path , PosixFilePermission permission ) throws IOException { Set < PosixFilePermission > perms = Files . getPosixFilePermissions ( path ) ; if ( perms . remove ( permission ) ) { Files . setPosixFilePermissions ( path , perms ) ; } }
removes a permission from a file or directory .
