org.uberfire.java.nio.file.Files.isReadable()方法的使用及代码示例

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

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

Files.isReadable介绍

暂无

代码示例

代码示例来源:origin: kiegroup/appformer

@Test
public void isReadableNull() {
  assertThatThrownBy(() -> Files.isReadable(null))
      .isInstanceOf(IllegalArgumentException.class)
      .hasMessage("Parameter named 'path' should be not null!");
}

代码示例来源:origin: kiegroup/appformer

@Test
public void isReadable() {
  final Path path = Files.createTempFile("foo", "bar");
  assertThat(Files.isReadable(path)).isTrue();
  assertThat(Files.isReadable(newTempDir())).isTrue();
  assertThat(Files.isReadable(Paths.get("/some/file"))).isFalse();
}

代码示例来源:origin: org.kie.workbench.services/kie-wb-common-compiler-core

@Override
public ProcessedPoms process(final CompilationRequest req) {
  if (!isValidConfiguration) {
    return new ProcessedPoms(Boolean.FALSE, Collections.emptyList());
  }
  Path mainPom = Paths.get(URI.create(FILE_URI + req.getKieCliRequest().getWorkingDirectory() + "/" + POM_NAME));
  if (!Files.isReadable(mainPom)) {
    return new ProcessedPoms(Boolean.FALSE, Collections.emptyList());
  }
  PomPlaceHolder placeHolder = editor.readSingle(mainPom);
  Boolean isPresent = isPresent(placeHolder);   // check if the main pom is already scanned and edited
  if (placeHolder.isValid() && !isPresent) {
    List<String> pomsList = MavenUtils.searchPoms(mainPom.getParent()); // recursive NIO search in all subfolders
    boolean result = false;
    if (pomsList.size() > 0) {
      result = processFoundPoms(pomsList,
                   req);
    }
    return new ProcessedPoms(result,
                 pomsList);
  } else {
    return new ProcessedPoms(Boolean.FALSE,
                 Collections.emptyList());
  }
}

相关文章