@Test public void hasEntry_testFolderHasDirectChild() throws Exception { createEntry(testFolder.resolve("toto.dp"), "contentId", "folderId", FolderContentType.PREPARATION); assertTrue(FileSystemUtils.hasEntry(testFolder)); }
static boolean hasEntry(Path path) { boolean hasChild; try (Stream<Path> pathsStream = Files.walk(path)) { hasChild = pathsStream.filter(Files::isRegularFile).map(FileSystemUtils::toFolderEntry).findAny().isPresent(); } catch (IOException e) { throw new TDPException(UNABLE_TO_DELETE_FOLDER, e, build().put("path", path)); } return hasChild; }
FileSystemUtils { static boolean hasEntry(Path path) { boolean hasChild; try (Stream<Path> pathsStream = Files.walk(path)) { hasChild = pathsStream.filter(Files::isRegularFile).map(FileSystemUtils::toFolderEntry).findAny().isPresent(); } catch (IOException e) { throw new TDPException(UNABLE_TO_DELETE_FOLDER, e, build().put("path", path)); } return hasChild; } }
FileSystemUtils { static boolean hasEntry(Path path) { boolean hasChild; try (Stream<Path> pathsStream = Files.walk(path)) { hasChild = pathsStream.filter(Files::isRegularFile).map(FileSystemUtils::toFolderEntry).findAny().isPresent(); } catch (IOException e) { throw new TDPException(UNABLE_TO_DELETE_FOLDER, e, build().put("path", path)); } return hasChild; } private  FileSystemUtils(); }
FileSystemUtils { static boolean hasEntry(Path path) { boolean hasChild; try (Stream<Path> pathsStream = Files.walk(path)) { hasChild = pathsStream.filter(Files::isRegularFile).map(FileSystemUtils::toFolderEntry).findAny().isPresent(); } catch (IOException e) { throw new TDPException(UNABLE_TO_DELETE_FOLDER, e, build().put("path", path)); } return hasChild; } private  FileSystemUtils(); static String toId(FolderPath folderPath); static FolderPath fromId(String id); }
FileSystemUtils { static boolean hasEntry(Path path) { boolean hasChild; try (Stream<Path> pathsStream = Files.walk(path)) { hasChild = pathsStream.filter(Files::isRegularFile).map(FileSystemUtils::toFolderEntry).findAny().isPresent(); } catch (IOException e) { throw new TDPException(UNABLE_TO_DELETE_FOLDER, e, build().put("path", path)); } return hasChild; } private  FileSystemUtils(); static String toId(FolderPath folderPath); static FolderPath fromId(String id);  }