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

x33g5p2x  于2022-01-26 转载在 其他  
字(4.0k)|赞(0)|评价(0)|浏览(92)

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

Path.endsWith介绍

暂无

代码示例

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

private boolean hasContent(Path dir) {
  // TODO remove this filter when AF-1073 is resolved
  try (DirectoryStream<Path> children = newDirectoryStream(dir, path -> !path.endsWith("readme.md"))) {
    return children.iterator().hasNext();
  }
}

代码示例来源:origin: org.uberfire/uberfire-metadata-commons-io

private boolean hasContent(Path dir) {
  // TODO remove this filter when AF-1073 is resolved
  try (DirectoryStream<Path> children = newDirectoryStream(dir, path -> !path.endsWith("readme.md"))) {
    return children.iterator().hasNext();
  }
}

代码示例来源:origin: org.jbpm/jbpm-wb-integration-backend

protected boolean isCaseProject(Path rootProjectPath) {

    org.uberfire.java.nio.file.DirectoryStream<Path> found = ioService.newDirectoryStream(rootProjectPath,
                                               f -> f.endsWith(CASE_PROJECT_DOT_FILE));
    return found.iterator().hasNext();
  }
}

代码示例来源:origin: kiegroup/jbpm-wb

protected boolean isCaseProject(Path rootProjectPath) {

    org.uberfire.java.nio.file.DirectoryStream<Path> found = ioService.newDirectoryStream(rootProjectPath,
                                               f -> f.endsWith(CASE_PROJECT_DOT_FILE));
    return found.iterator().hasNext();
  }
}

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

public static List<String> searchPoms(Path file) {
  List<String> poms = new ArrayList<>();
  try (DirectoryStream<Path> ds = Files.newDirectoryStream(file.toAbsolutePath())) {
    for (Path p : ds) {
      if (Files.isDirectory(p)) {
        poms.addAll(searchPoms(p));
      } else if (p.endsWith(CommonConstants.POM_NAME)) {
        poms.add(p.toAbsolutePath().toString());
      }
    }
  } catch (Exception e) {
    logger.error(e.getMessage());
  }
  return poms;
}

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

@Test
public void endsWith() {
  final Path path = GeneralPathImpl.create(fs,
                       "/path/to/file.txt",
                       false);
  assertThatThrownBy(() -> path.endsWith((String) null))
      .isInstanceOf(IllegalArgumentException.class)
      .hasMessage("Parameter named 'other' should be not null!");
}

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

@Test
public void endsWithPath() {
  final Path path = GeneralPathImpl.create(fs,
                       "/path/to/file.txt",
                       false);
  assertThatThrownBy(() -> path.endsWith((Path) null))
      .isInstanceOf(IllegalArgumentException.class)
      .hasMessage("Parameter named 'other' should be not null!");
}

代码示例来源:origin: kiegroup/drools-wb

@Test
  public void getActivatorPathTest() {
    assertTrue(service.getActivatorPath(mockedPackage).endsWith(ScenarioJunitActivator.ACTIVATOR_CLASS_NAME + ".java"));
  }
}

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

false);
assertTrue(path.endsWith(create(fs,
                "file.txt",
                false)));
assertFalse(path.endsWith(create(fs,
                 "anotherfile.txt",
                 false)));
assertTrue(path.endsWith(create(fs,
                "to\\file.txt",
                false)));
assertTrue(path.endsWith(create(fs,
                "to/file.txt",
                false)));
assertFalse(path.endsWith(create(fs,
                 "c:\\different\\path\\to\\file.txt",
                 false)));
assertFalse(path.endsWith(create(fs,
                 "d:\\path\\to\\another\\file.txt",
                 false)));
assertTrue(unixFormatPath.endsWith(create(fs,
                     "to\\file.txt",
                     false)));
assertTrue(path.endsWith(unixFormatPath));
assertTrue(unixFormatPath.endsWith(path));

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

@Test
public void endsWith() {
  when(fs.getSeparator()).thenReturn("/");
  final Path path = create(fs,
               "/path/to/file.txt",
               false);
  assertTrue(path.endsWith(create(fs,
                  "file.txt",
                  false)));
  assertTrue(path.endsWith(create(fs,
                  "to/file.txt",
                  false)));
  assertTrue(path.endsWith(create(fs,
                  "/path/to/file.txt",
                  false)));
  assertFalse(path.endsWith(create(fs,
                   "filename.txt",
                   false)));
  assertFalse(path.endsWith(create(fs,
                   "/some/other/path/to/file.txt",
                   false)));
  assertFalse(path.endsWith(create(fs,
                   "txt",
                   false)));
}

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

if (!child.getFileName().endsWith(deleteableFile)) {
  dirDescriptor.setDeleteable(false);
  return dirDescriptor;

相关文章