VirtualFileDiffElement (DiffElement<VirtualFile> container, String relativePath) { try { final File src = new File(myFile.getPath()); final File trg = new File(container.getValue().getPath() + relativePath + src.getName()); FileUtil.copy(src, trg); final VirtualFile virtualFile = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(trg); if (virtualFile != null) { return new VirtualFileDiffElement(virtualFile); } } catch (IOException e) {// } return null; }