Class GitHubConfigFileProviderImpl
java.lang.Object
io.quarkiverse.githubapp.runtime.github.GitHubConfigFileProviderImpl
- All Implemented Interfaces:
GitHubConfigFileProvider
@ApplicationScoped
public class GitHubConfigFileProviderImpl
extends Object
implements GitHubConfigFileProvider
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> Optional<T>fetchConfigFile(org.kohsuke.github.GHRepository repository, String path, ConfigFile.Source source, Class<T> type) Fetches the configuration file at the given path from the main branch of the given repository, optionally (iftypeis not justString) deserializing it to the given type using Jackson.<T> Optional<T>fetchConfigFile(org.kohsuke.github.GHRepository repository, String ref, String path, ConfigFile.Source source, Class<T> type) Fetches the configuration file at the given path from the given ref of the given repository, optionally (iftypeis not justString) deserializing it to the given type using Jackson.static StringgetFilePath(String path)
-
Constructor Details
-
GitHubConfigFileProviderImpl
public GitHubConfigFileProviderImpl()
-
-
Method Details
-
fetchConfigFile
public <T> Optional<T> fetchConfigFile(org.kohsuke.github.GHRepository repository, String path, ConfigFile.Source source, Class<T> type) Description copied from interface:GitHubConfigFileProviderFetches the configuration file at the given path from the main branch of the given repository, optionally (iftypeis not justString) deserializing it to the given type using Jackson.NOTE: You generally will not need this method when processing events, as configuration files can be automatically injected into event listener methods, simply by annotating a parameter with
ConfigFile. This provider is mostly useful for non-event use cases (e.g. cron jobs).- Specified by:
fetchConfigFilein interfaceGitHubConfigFileProvider- Parameters:
repository- The GitHub code repository to retrieve the file from.path- The path to the file in the code repository, either absolute (if it starts with/) or relative to/.github/(if it doesn't start with/).source- Which repository to extract the file from in the case of forked repositories.type- The type to deserialize the file to.- Returns:
- The configuration file wrapped in an
Optional, orOptional.empty()if it is missing. - See Also:
-
fetchConfigFile
public <T> Optional<T> fetchConfigFile(org.kohsuke.github.GHRepository repository, String ref, String path, ConfigFile.Source source, Class<T> type) Description copied from interface:GitHubConfigFileProviderFetches the configuration file at the given path from the given ref of the given repository, optionally (iftypeis not justString) deserializing it to the given type using Jackson.NOTE: You generally will not need this method when processing events, as configuration files can be automatically injected into event listener methods, simply by annotating a parameter with
ConfigFile. This provider is mostly useful for non-event use cases (e.g. cron jobs).- Specified by:
fetchConfigFilein interfaceGitHubConfigFileProvider- Parameters:
repository- The GitHub code repository to retrieve the file from.ref- The git ref (branch, commit SHA, ...) to retrieve the file from.path- The path to the file in the code repository, either absolute (if it starts with/) or relative to/.github/(if it doesn't start with/).source- Which repository to extract the file from in the case of forked repositories.type- The type to deserialize the file to.- Returns:
- The configuration file wrapped in an
Optional, orOptional.empty()if it is missing. - See Also:
-
getFilePath
-