VirtualFile (final @NotNull VirtualFile file, final @NotNull VirtualFile newParent, final @NotNull String copyName) { final VirtualFile[] copy = new VirtualFile[1]; try { WriteCommandAction.writeCommandAction(null).run(() -> copy[0] = file.copy(file, newParent, copyName)); } catch (IOException e) { throw new RuntimeException(e); } return copy[0]; }