Here you can find the source of mapValue(PosixFilePermission p)
private static int mapValue(PosixFilePermission p)
//package com.java2s; //License from project: Open Source License import java.nio.file.attribute.PosixFilePermission; public class Main { private static int mapValue(PosixFilePermission p) { switch (p) { case GROUP_EXECUTE: return 1 * 8; case GROUP_READ: return 4 * 8; case GROUP_WRITE: return 2 * 8; case OWNER_EXECUTE: return 1 * 8 * 8; case OWNER_READ: return 4 * 8 * 8; case OWNER_WRITE: return 2 * 8 * 8; case OTHERS_EXECUTE: return 1; case OTHERS_READ: return 4; case OTHERS_WRITE: return 2; default:// www . j a va2 s. c o m throw new RuntimeException("Unknown permission"); } } }