Here you can find the source of fromPosixPermission(PosixFilePermission permission)
private static String fromPosixPermission(PosixFilePermission permission)
//package com.java2s; /*//from w w w .j ava 2 s . c o m * Copyright 2013-2015 EMC Corporation. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://www.apache.org/licenses/LICENSE-2.0.txt * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ import java.nio.file.attribute.*; public class Main { public static final String READ = "READ"; public static final String WRITE = "WRITE"; public static final String EXECUTE = "EXECUTE"; private static String fromPosixPermission(PosixFilePermission permission) { switch (permission) { case OWNER_READ: case GROUP_READ: case OTHERS_READ: return READ; case OWNER_WRITE: case GROUP_WRITE: case OTHERS_WRITE: return WRITE; case OWNER_EXECUTE: case GROUP_EXECUTE: case OTHERS_EXECUTE: return EXECUTE; default: throw new IllegalArgumentException("unknown POSIX permission: " + permission); } } }