private @Nullable FileTemplateBase addTemplateFromFile(@NotNull String fileName, @Nullable InputStream stream) {
    Pair<String, String> nameExt = decodeFileName(fileName);
    final String extension = nameExt.second;
    final String templateQName = nameExt.first;
    if (templateQName.isEmpty()) {
      return null;
    }
    FileTemplateBase template = addTemplate(templateQName, extension);
    template.setText(stream != null ? readText(stream) : readFile(fileName));
    return template;
  }
private @Nullable FileTemplateBase addTemplateFromFile(@NotNull String fileName, @Nullable InputStream stream)