private static @Nullable NewFileLocation getNewFileLocation(@NotNull FileReference reference,
                                                              String newFileName,
                                                              PsiFile containingFile,
                                                              boolean isDirectory) {
    @Nullable
    Module module = ModuleUtilCore.findModuleForPsiElement(containingFile);

    List<TargetDirectory> targetDirectories = getTargets(reference, module, newFileName, isDirectory);
    if (targetDirectories.isEmpty()) {
      return null;
    }
    return new NewFileLocation(targetDirectories, getPathToReferencePart(reference), newFileName);
  }
private static @Nullable NewFileLocation getNewFileLocation(@NotNull FileReference reference,
                                                              String newFileName,
                                                              PsiFile containingFile,
                                                              boolean isDirectory)