- java.lang.Object
-
- org.github.gestalt.config.git.GitConfigSource
-
- All Implemented Interfaces:
org.github.gestalt.config.source.ConfigSource
public final class GitConfigSource extends java.lang.Object implements org.github.gestalt.config.source.ConfigSourceLoads a file from git.
-
-
Constructor Summary
Constructors Constructor Description GitConfigSource(java.lang.String repoURI, java.nio.file.Path localRepoDirectory, java.lang.String configFilePath, java.lang.String branch, org.eclipse.jgit.transport.CredentialsProvider credentials, org.eclipse.jgit.transport.SshSessionFactory sshSessionFactory)Create a new GitConfigSources.GitConfigSource(java.lang.String repoURI, java.nio.file.Path localRepoDirectory, java.lang.String configFilePath, java.lang.String branch, org.eclipse.jgit.transport.CredentialsProvider credentials, org.eclipse.jgit.transport.SshSessionFactory sshSessionFactory, org.github.gestalt.config.tag.Tags tags)Deprecated, for removal: This API element is subject to removal in a future version.Tags should be added via the builder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)java.lang.Stringformat()org.github.gestalt.config.tag.TagsgetTags()inthashCode()booleanhasList()booleanhasStream()java.util.UUIDid()java.util.List<org.github.gestalt.config.utils.Pair<java.lang.String,java.lang.String>>loadList()java.io.InputStreamloadStream()java.lang.Stringname()
-
-
-
Constructor Detail
-
GitConfigSource
public GitConfigSource(java.lang.String repoURI, java.nio.file.Path localRepoDirectory, java.lang.String configFilePath, java.lang.String branch, org.eclipse.jgit.transport.CredentialsProvider credentials, org.eclipse.jgit.transport.SshSessionFactory sshSessionFactory) throws org.github.gestalt.config.exceptions.GestaltExceptionCreate a new GitConfigSources.- Parameters:
repoURI- the URI to the git repolocalRepoDirectory- the local directory you want to save the git repo to.configFilePath- the path to the config file in the git repobranch- the branch you want to pull from gitcredentials- If authenticating with credentials, the CredentialsProvider such as UsernamePasswordCredentialsProvidersshSessionFactory- If using sshd the SshSessionFactory, this uses apache mina-sshd. The easiest way is to use the apache mina-sshd SshdSessionFactoryBuilder.- Throws:
org.github.gestalt.config.exceptions.GestaltException- if there is a badly configured git repo
-
GitConfigSource
@Deprecated(since="0.26.0", forRemoval=true) public GitConfigSource(java.lang.String repoURI, java.nio.file.Path localRepoDirectory, java.lang.String configFilePath, java.lang.String branch, org.eclipse.jgit.transport.CredentialsProvider credentials, org.eclipse.jgit.transport.SshSessionFactory sshSessionFactory, org.github.gestalt.config.tag.Tags tags) throws org.github.gestalt.config.exceptions.GestaltExceptionDeprecated, for removal: This API element is subject to removal in a future version.Tags should be added via the builder. Storage of the tags have been moved toConfigSourcePackage.getTags().Create a new GitConfigSources.- Parameters:
repoURI- the URI to the git repolocalRepoDirectory- the local directory you want to save the git repo to.configFilePath- the path to the config file in the git repobranch- the branch you want to pull from gitcredentials- If authenticating with credentials, the CredentialsProvider such as UsernamePasswordCredentialsProvidersshSessionFactory- If using sshd the SshSessionFactory, this uses apache mina-sshd. The easiest way is to use the apache mina-sshd SshdSessionFactoryBuilder.tags- tags associated with the source- Throws:
org.github.gestalt.config.exceptions.GestaltException- if there is a badly configured git repo
-
-
Method Detail
-
hasStream
public boolean hasStream()
- Specified by:
hasStreamin interfaceorg.github.gestalt.config.source.ConfigSource
-
loadStream
public java.io.InputStream loadStream() throws org.github.gestalt.config.exceptions.GestaltException- Specified by:
loadStreamin interfaceorg.github.gestalt.config.source.ConfigSource- Throws:
org.github.gestalt.config.exceptions.GestaltException
-
hasList
public boolean hasList()
- Specified by:
hasListin interfaceorg.github.gestalt.config.source.ConfigSource
-
loadList
public java.util.List<org.github.gestalt.config.utils.Pair<java.lang.String,java.lang.String>> loadList() throws org.github.gestalt.config.exceptions.GestaltException- Specified by:
loadListin interfaceorg.github.gestalt.config.source.ConfigSource- Throws:
org.github.gestalt.config.exceptions.GestaltException
-
format
public java.lang.String format()
- Specified by:
formatin interfaceorg.github.gestalt.config.source.ConfigSource
-
name
public java.lang.String name()
- Specified by:
namein interfaceorg.github.gestalt.config.source.ConfigSource
-
id
public java.util.UUID id()
- Specified by:
idin interfaceorg.github.gestalt.config.source.ConfigSource
-
getTags
public org.github.gestalt.config.tag.Tags getTags()
- Specified by:
getTagsin interfaceorg.github.gestalt.config.source.ConfigSource
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-