private @Nullable PsiFile createFile(final String text, final String name) {
    final FileType fileType = myVelocityFileType;
    if (fileType == FileTypes.UNKNOWN) return null;

    final PsiFile file = PsiFileFactory.getInstance(myProject).createFileFromText(name + ".txt.ft", fileType, text, 0, true);
    Properties properties = new Properties();
    properties.putAll(FileTemplateManager.getInstance(myProject).getDefaultProperties());
    properties.setProperty(FileTemplate.ATTRIBUTE_NAME, IdeBundle.message("name.variable"));
    file.getViewProvider().putUserData(FileTemplateManager.DEFAULT_TEMPLATE_PROPERTIES, properties);
    return file;
  }
private @Nullable PsiFile createFile(final String text, final String name)