VirtualFile (@NotNull FilePath filePath) { VirtualFile result = filePath.getVirtualFile(); if (result != null) return result; String path = filePath.getPath(); if (!ApplicationManager.getApplication().isReadAccessAllowed()) { result = LocalFileSystem.getInstance().refreshAndFindFileByPath(path); if (result != null) return result; } Pair<NewVirtualFile, NewVirtualFile> pair = VfsImplUtil.findCachedFileByPath(LocalFileSystem.getInstance(), path); return pair.first != null ? pair.first : pair.second; }