alluxio.security.authorization.Mode.toString()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(3.2k)|赞(0)|评价(0)|浏览(124)

本文整理了Java中alluxio.security.authorization.Mode.toString()方法的一些代码示例,展示了Mode.toString()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Mode.toString()方法的具体详情如下:
包路径:alluxio.security.authorization.Mode
类名称:Mode
方法名:toString

Mode.toString介绍

暂无

代码示例

代码示例来源:origin: Alluxio/alluxio

private static String toExceptionMessage(String user, Mode.Bits bits, String path,
   Inode inode) {
  StringBuilder sb =
    new StringBuilder().append("user=").append(user).append(", ").append("access=").append(bits)
      .append(", ").append("path=").append(path).append(": ").append("failed at ")
      .append(inode.getName().equals("") ? "/" : inode.getName()).append(", inode owner=")
      .append(inode.getOwner()).append(", inode group=").append(inode.getGroup())
      .append(", inode mode=").append(new Mode(inode.getMode()).toString());
  return sb.toString();
 }
}

代码示例来源:origin: Alluxio/alluxio

/**
 * Formats digital representation of a model as a human-readable string.
 *
 * @param mode file mode
 * @param directory if the mode corresponds to a directory
 * @param hasExtended true if extended acls exist
 * @return human-readable version of the given mode
 */
public static String formatMode(short mode, boolean directory, boolean hasExtended) {
 StringBuilder str = new StringBuilder();
 if (directory) {
  str.append("d");
 } else {
  str.append("-");
 }
 str.append(new Mode(mode).toString());
 if (hasExtended) {
  str.append("+");
 }
 return str.toString();
}

代码示例来源:origin: Alluxio/alluxio

@Override
public void setMode(String path, short mode) throws IOException {
 path = stripPath(path);
 String posixPerm = new Mode(mode).toString();
 FileUtils.changeLocalFilePermission(path, posixPerm);
}

代码示例来源:origin: Alluxio/alluxio

/**
 * Tests the {@link Mode#toString()} method.
 */
@Test
public void toStringTest() {
 assertEquals("rwxrwxrwx", new Mode((short) 0777).toString());
 assertEquals("rw-r-----", new Mode((short) 0640).toString());
 assertEquals("rw-------", new Mode((short) 0600).toString());
 assertEquals("---------", new Mode((short) 0000).toString());
}

代码示例来源:origin: org.alluxio/alluxio-core-common

/**
 * Formats digital representation of a model as a human-readable string.
 *
 * @param mode file mode
 * @param directory if the mode corresponds to a directory
 * @return human-readable version of the given mode
 */
public static String formatMode(short mode, boolean directory) {
 StringBuilder str = new StringBuilder();
 if (directory) {
  str.append("d");
 } else {
  str.append("-");
 }
 str.append(new Mode(mode).toString());
 return str.toString();
}

代码示例来源:origin: org.alluxio/alluxio-core-server-master

private static String toExceptionMessage(String user, Mode.Bits bits, String path,
   Inode<?> inode) {
  StringBuilder sb =
    new StringBuilder().append("user=").append(user).append(", ").append("access=").append(bits)
      .append(", ").append("path=").append(path).append(": ").append("failed at ")
      .append(inode.getName().equals("") ? "/" : inode.getName()).append(", inode owner=")
      .append(inode.getOwner()).append(", inode group=").append(inode.getGroup())
      .append(", inode mode=").append(new Mode(inode.getMode()).toString());
  return sb.toString();
 }
}

相关文章