Class GitHubTemplateDownloader

java.lang.Object
com.pragma.archetype.infrastructure.adapter.out.template.GitHubTemplateDownloader

public class GitHubTemplateDownloader extends Object
Downloads templates from GitHub repository. Supports GitHub, GitLab, and Bitbucket.
  • Constructor Details

  • Method Details

    • downloadTemplate

      public String downloadTemplate(TemplateConfig config, String templatePath)
      Downloads a template file from the configured repository.
      Parameters:
      config - template configuration
      templatePath - relative path to template (e.g., "templates/frameworks/spring/...")
      Returns:
      template content
      Throws:
      HttpClientPort.HttpDownloadException - if download fails or branch doesn't exist
    • templateExists

      public boolean templateExists(TemplateConfig config, String templatePath)
      Checks if a template exists in the repository.
      Parameters:
      config - template configuration
      templatePath - relative path to template
      Returns:
      true if template exists, false otherwise
    • validateRemoteRepository

      public boolean validateRemoteRepository(TemplateConfig config)
      Validates that the remote repository and branch are accessible.
      Parameters:
      config - template configuration
      Returns:
      true if repository and branch are accessible, false otherwise
    • getCache

      public TemplateCache getCache()
      Gets the cache instance.