void (String relativePath) { File dir = PathManagerEx.findFileUnderProjectHome(relativePath, getClass()); final File target = new File(FileUtil.toSystemDependentName(getProjectBasePath())); try { FileUtil.copyDir(dir, target); } catch (IOException e) { throw new RuntimeException(e); } WriteAction.runAndWait(() -> { VirtualFile virtualDir = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(target); assertNotNull(target.getAbsolutePath() + " not found", virtualDir); virtualDir.refresh(false, true); }); }