List of usage examples for org.apache.hadoop.fs FileUtil canExecute
public static boolean canExecute(File f)
From source file:com.mellanox.r4h.MiniDFSCluster.java
License:Apache License
/** * @return a debug string which can help diagnose an error of why * a given directory might have a permissions error in the context * of a test case/*from ww w. j a v a2s . c o m*/ */ private String createPermissionsDiagnosisString(File path) { StringBuilder sb = new StringBuilder(); while (path != null) { sb.append("path '" + path + "': ").append("\n"); sb.append("\tabsolute:").append(path.getAbsolutePath()).append("\n"); sb.append("\tpermissions: "); sb.append(path.isDirectory() ? "d" : "-"); sb.append(FileUtil.canRead(path) ? "r" : "-"); sb.append(FileUtil.canWrite(path) ? "w" : "-"); sb.append(FileUtil.canExecute(path) ? "x" : "-"); sb.append("\n"); path = path.getParentFile(); } return sb.toString(); }