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(); } }
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(); } }
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(); } }
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(); } }
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; }
@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!"); }
@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!"); }
@Test public void getActivatorPathTest() { assertTrue(service.getActivatorPath(mockedPackage).endsWith(ScenarioJunitActivator.ACTIVATOR_CLASS_NAME + ".java")); } }
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));
@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))); }
if (!child.getFileName().endsWith(deleteableFile)) { dirDescriptor.setDeleteable(false); return dirDescriptor;