void (final PsiElement[] elements, PsiDirectory defaultTargetDirectory) { if (defaultTargetDirectory == null) { PsiDirectory commonParent = getCommonParentDirectory(elements); if (commonParent != null && !ScratchUtil.isScratch(commonParent.getVirtualFile())) { defaultTargetDirectory = commonParent; } } Project project = defaultTargetDirectory != null ? defaultTargetDirectory.getProject() : elements [0].getProject(); if (defaultTargetDirectory != null) { defaultTargetDirectory = resolveDirectory(defaultTargetDirectory); if (defaultTargetDirectory == null) return; } defaultTargetDirectory = tryNotNullizeDirectory(project, defaultTargetDirectory); copyAsFiles(elements, defaultTargetDirectory, project); }