VirtualFile (@NotNull String name) { Path file; try { file = createEmptyTempFile(createTempDirectory(), name); } catch (IOException e) { throw new RuntimeException(e); } VfsRootAccess.allowRootAccess(getTestRootDisposable(), file.toString()); return WriteAction.computeAndWait(() -> { return LocalFileSystem.getInstance().refreshAndFindFileByPath(FileUtil.toSystemIndependentName(file.toString())); }); }