Class GitHubTemplateDownloader
java.lang.Object
com.pragma.archetype.infrastructure.adapter.out.template.GitHubTemplateDownloader
Downloads templates from GitHub repository.
Supports GitHub, GitLab, and Bitbucket.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondownloadTemplate(TemplateConfig config, String templatePath) Downloads a template file from the configured repository.getCache()Gets the cache instance.booleantemplateExists(TemplateConfig config, String templatePath) Checks if a template exists in the repository.booleanValidates that the remote repository and branch are accessible.
-
Constructor Details
-
GitHubTemplateDownloader
-
-
Method Details
-
downloadTemplate
Downloads a template file from the configured repository.- Parameters:
config- template configurationtemplatePath- relative path to template (e.g., "templates/frameworks/spring/...")- Returns:
- template content
- Throws:
HttpClientPort.HttpDownloadException- if download fails or branch doesn't exist
-
templateExists
Checks if a template exists in the repository.- Parameters:
config- template configurationtemplatePath- relative path to template- Returns:
- true if template exists, false otherwise
-
validateRemoteRepository
Validates that the remote repository and branch are accessible.- Parameters:
config- template configuration- Returns:
- true if repository and branch are accessible, false otherwise
-
getCache
Gets the cache instance.
-