Class GitHubRepositoryName


  • public class GitHubRepositoryName
    extends Object
    Uniquely identifies a repository on GitHub.
    Author:
    Kohsuke Kawaguchi
    • Field Detail

      • host

        public final String host
      • userName

        public final String userName
      • repositoryName

        public final String repositoryName
    • Constructor Detail

      • GitHubRepositoryName

        public GitHubRepositoryName​(String host,
                                    String userName,
                                    String repositoryName)
    • Method Detail

      • getHost

        public String getHost()
      • getUserName

        public String getUserName()
      • getRepositoryName

        public String getRepositoryName()
      • resolve

        public Iterable<org.kohsuke.github.GHRepository> resolve()
        Resolves this name to the actual reference by GHRepository Shortcut for resolve(Predicate) with always true predicate (Predicates.alwaysTrue()) as argument
      • resolve

        public Iterable<org.kohsuke.github.GHRepository> resolve​(com.google.common.base.Predicate<GitHubServerConfig> predicate)
        Resolves this name to the actual reference by GHRepository. Since the system can store multiple credentials, and only some of them might be able to see this name in question, this method uses GitHubPluginConfig.findGithubConfig(Predicate) and attempt to find the right credential that can access this repository. Any predicate as argument will be combined with GitHubServerConfig.withHost(String) to find only corresponding for this repo name authenticated github repository This method walks multiple repositories for each credential that can access the repository. Depending on what you are trying to do with the repository, you might have to keep trying until a GHRepository with suitable permission is returned.
        Parameters:
        predicate - helps to filter only useful for resolve GitHubServerConfigs
        Returns:
        iterable with lazy login process for getting authenticated repos
        Since:
        1.13.0
      • resolveOne

        @CheckForNull
        public org.kohsuke.github.GHRepository resolveOne()
        Variation of resolve() method that just returns the first valid repository object. This is useful if the caller only relies on the read access to the repository and doesn't need to walk possible candidates.
      • matches

        public boolean matches​(org.kohsuke.github.GHCommitPointer commit)
        Does this repository match the repository referenced in the given GHCommitPointer?
      • matches

        public boolean matches​(org.kohsuke.github.GHRepository repo)
                        throws IOException
        Does this repository match the repository referenced in the given GHCommitPointer?
        Throws:
        IOException
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object