private @NotNull PsiElement createFile(@Nullable String fileName,
                                         @NotNull FileTemplate template,
                                         @NotNull Properties properties) throws Exception {
    if (fileName != null) {
      String newName = FileTemplateUtil.mergeTemplate(properties, fileName, false);
      CreateFileAction.MkDirs mkDirs = WriteAction.compute(() -> new CreateFileAction.MkDirs(newName, myDirectory));
      return FileTemplateUtil.createFromTemplate(template, mkDirs.newName, properties, mkDirs.directory);
    }
    return FileTemplateUtil.createFromTemplate(template, null, properties, myDirectory);
  }
private @NotNull PsiElement createFile(@Nullable String fileName,
                                         @NotNull FileTemplate template,
                                         @NotNull Properties properties)