Class GitHubRepositoryName

java.lang.Object
com.cloudbees.jenkins.GitHubRepositoryName

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

    • host Link icon

      public final String host
    • userName Link icon

      public final String userName
    • repositoryName Link icon

      public final String repositoryName
  • Constructor Details Link icon

    • GitHubRepositoryName Link icon

      public GitHubRepositoryName(String host, String userName, String repositoryName)
  • Method Details Link icon

    • create Link icon

      @CheckForNull public static GitHubRepositoryName create(String url)
      Create GitHubRepositoryName from URL
      Parameters:
      url - repo url. Can be null
      Returns:
      parsed GitHubRepositoryName or null if it cannot be parsed from the specified URL
    • create Link icon

      @CheckForNull public static GitHubRepositoryName create(GithubProjectProperty projectProperty)
      Parameters:
      projectProperty - project property to extract url. Can be null
      Returns:
      parsed as GitHubRepositoryName object url to GitHub project
      Since:
      1.14.1
      See Also:
    • getHost Link icon

      public String getHost()
    • getUserName Link icon

      public String getUserName()
    • getRepositoryName Link icon

      public String getRepositoryName()
    • resolve Link icon

      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 Link icon

      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 Link icon

      @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 Link icon

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

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

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode Link icon

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString Link icon

      public String toString()
      Overrides:
      toString in class Object