LookupFile (@NotNull String path) { if (myUseVfs) { VirtualFile byUrl = VirtualFileManager.getInstance().findFileByUrl(path); if (byUrl != null) { return new VfsFile(byUrl); } } String toFind = normalize(path); if (toFind.isEmpty()) { if (myUseVfs) { toFind = FileSystems.getDefault().getRootDirectories().iterator().next().toString(); } else { return SystemInfo.isWindows ? WindowsRootsFile.TOP_ALL : null; } } if (myUseVfs) { // '..' and '.' path components will be eliminated VirtualFile vFile = LocalFileSystem.getInstance().findFileByPath(toFind); if (vFile != null) { return new VfsFile(vFile); } } try { Path file = Path.of(toFind); if (file.isAbsolute()) { return new IoFile(file); } else if (isIncompleteDrive(toFind) && SystemInfo.isWindows) { return WindowsRootsFile.INCOMPLETE_DRIVES; } } catch (InvalidPathException ignored) { if (isIncompleteUnc(toFind) && WSLUtil.isSystemCompatible()) { return toFind.equals("\\\\") ? WindowsRootsFile.TOP_WSL : WindowsRootsFile.INCOMPLETE_WSL; } } return null; }