void (@Nullable NewVirtualFile file, @NotNull Iterator<String> path, @NotNull Consumer<? super @Nullable NewVirtualFile> consumer) { if (file == null || !path.hasNext()) { consumer.accept(file); return; } String pathElement = path.next(); if (pathElement.isEmpty() || ".".equals(pathElement)) { refreshAndFindFileByPath(file, path, consumer); } else if ("..".equals(pathElement)) { if (file.is(VFileProperty.SYMLINK)) { String canonicalPath = file.getCanonicalPath(); if (canonicalPath != null) { refreshAndFindFileByPath(file.getFileSystem(), canonicalPath, canonicalFile -> refreshAndFindFileByPath(canonicalFile, path, consumer)); } else { consumer.accept(null); } } else { refreshAndFindFileByPath(file.getParent(), path, consumer); } } else { NewVirtualFile child = file.findChild(pathElement); if (child != null) { refreshAndFindFileByPath(child, path, consumer); } else { file.refresh(true, false, () -> ProcessIOExecutorService.INSTANCE.execute(() -> refreshAndFindFileByPath(file.findChild(pathElement), path, consumer) )); } } }