org.apache.hadoop.fs.FileUtil.setReadable()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(110)

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

FileUtil.setReadable介绍

[英]Platform independent implementation for File#setReadable(boolean)File#setReadable does not work as expected on Windows.
[中]文件#setReadable(布尔)文件#setReadable的平台独立实现在Windows上无法按预期工作。

代码示例

代码示例来源:origin: org.apache.hadoop/hadoop-common

private static void grantPermissions(final File f) {
  FileUtil.setExecutable(f, true);
  FileUtil.setReadable(f, true);
  FileUtil.setWritable(f, true);
}

代码示例来源:origin: io.hops/hadoop-common

private static void grantPermissions(final File f) {
 FileUtil.setExecutable(f, true);
 FileUtil.setReadable(f, true);
 FileUtil.setWritable(f, true);
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

private static void grantPermissions(final File f) {
  FileUtil.setExecutable(f, true);
  FileUtil.setReadable(f, true);
  FileUtil.setWritable(f, true);
}

代码示例来源:origin: io.prestosql.hadoop/hadoop-apache

private static void grantPermissions(final File f) {
  FileUtil.setExecutable(f, true);
  FileUtil.setReadable(f, true);
  FileUtil.setWritable(f, true);
}

代码示例来源:origin: ch.cern.hadoop/hadoop-common

private static void grantPermissions(final File f) {
  FileUtil.setExecutable(f, true);
  FileUtil.setReadable(f, true);
  FileUtil.setWritable(f, true);
}

代码示例来源:origin: ch.cern.hadoop/hadoop-common

private static void grantPermissions(final File f) {
 FileUtil.setReadable(f, true);
 FileUtil.setWritable(f, true);
 FileUtil.setExecutable(f, true);
}

代码示例来源:origin: ch.cern.hadoop/hadoop-common

private static void revokePermissions(final File f) {
  FileUtil.setWritable(f, false);
  FileUtil.setExecutable(f, false);
  FileUtil.setReadable(f, false);
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

private static void grantPermissions(final File f) {
 FileUtil.setReadable(f, true);
 FileUtil.setWritable(f, true);
 FileUtil.setExecutable(f, true);
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

private static void revokePermissions(final File f) {
  FileUtil.setWritable(f, false);
  FileUtil.setExecutable(f, false);
  FileUtil.setReadable(f, false);
}

代码示例来源:origin: ch.cern.hadoop/hadoop-common

FileUtil.setReadable(testFile, false);
assertFalse(NativeIO.Windows.access(testFile.getAbsolutePath(),
  NativeIO.Windows.AccessRight.ACCESS_READ));
FileUtil.setReadable(testFile, true);
assertTrue(NativeIO.Windows.access(testFile.getAbsolutePath(),
  NativeIO.Windows.AccessRight.ACCESS_READ));
FileUtil.setReadable(testFile, false);
assertFalse(NativeIO.Windows.access(testFile.getAbsolutePath(),
  NativeIO.Windows.AccessRight.ACCESS_READ));
FileUtil.setReadable(testFile, true);
assertTrue(NativeIO.Windows.access(testFile.getAbsolutePath(),
  NativeIO.Windows.AccessRight.ACCESS_READ));

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

FileUtil.setReadable(testFile, false);
assertFalse(NativeIO.Windows.access(testFile.getAbsolutePath(),
  NativeIO.Windows.AccessRight.ACCESS_READ));
FileUtil.setReadable(testFile, true);
assertTrue(NativeIO.Windows.access(testFile.getAbsolutePath(),
  NativeIO.Windows.AccessRight.ACCESS_READ));
FileUtil.setReadable(testFile, false);
assertFalse(NativeIO.Windows.access(testFile.getAbsolutePath(),
  NativeIO.Windows.AccessRight.ACCESS_READ));
FileUtil.setReadable(testFile, true);
assertTrue(NativeIO.Windows.access(testFile.getAbsolutePath(),
  NativeIO.Windows.AccessRight.ACCESS_READ));

相关文章