void (@NotNull DirectoryEntry parent, @NotNull String path, @NotNull Iterable<? extends VirtualFile> children) { for (VirtualFile child : children) { String name = StringUtil.trimStart(child.getName(), "/"); // on Mac FS root name is "/" if (!path.startsWith(name)) continue; String rest = path.substring(name.length()); if (!rest.isEmpty() && rest.charAt(0) != '/') continue; if (!rest.isEmpty() && rest.charAt(0) == '/') { rest = rest.substring(1); } Entry e = doCreateEntryForPathOnly(child, rest); if (e == null) continue; parent.addChild(e); } }