Java Files get Posix file permissions
import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.attribute.PosixFilePermission; import java.util.Set; public class Main { public static void main(String[] args) { Path path = Paths.get("home/docs/users.txt"); try {// w ww.j ava 2 s . c om Set<PosixFilePermission> permissions = Files.getPosixFilePermissions(path); System.out.print("Permissions: "); for (PosixFilePermission permission : permissions) { System.out.print(permission.name() + " "); } System.out.println(); } catch (IOException ex) { ex.printStackTrace(); } } }