Class GitRepositoryBrowser

All Implemented Interfaces:
ExtensionPoint, Describable<RepositoryBrowser<?>>, Serializable
Direct Known Subclasses:
AssemblaWeb, BitbucketServer, BitbucketWeb, CGit, FisheyeGitRepositoryBrowser, GitBlitRepositoryBrowser, GithubWeb, Gitiles, GitLab, GitList, GitoriousWeb, GitWeb, GogsGit, KilnGit, Phabricator, RedmineWeb, RhodeCode, Stash, TFS2013GitRepositoryBrowser, ViewGitWeb

public abstract class GitRepositoryBrowser extends RepositoryBrowser<GitChangeSet>
See Also:
  • Constructor Details

    • GitRepositoryBrowser

      @Deprecated protected GitRepositoryBrowser()
      Deprecated.
    • GitRepositoryBrowser

      protected GitRepositoryBrowser(String repourl)
  • Method Details

    • getRepoUrl

      public final String getRepoUrl()
    • getUrl

      public final URL getUrl() throws IOException
      Throws:
      IOException
    • getDiffLink

      public abstract URL getDiffLink(GitChangeSet.Path path) throws IOException
      Determines the link to the diff between the version in the specified revision of GitChangeSet.Path to its previous version.
      Parameters:
      path - affected file path
      Returns:
      null if the browser doesn't have any URL for diff.
      Throws:
      IOException - on input or output error
    • getFileLink

      public abstract URL getFileLink(GitChangeSet.Path path) throws IOException, URISyntaxException
      Determines the link to a single file under Git. This page should display all the past revisions of this file, etc.
      Parameters:
      path - affected file path
      Returns:
      null if the browser doesn't have any suitable URL.
      Throws:
      IOException - on input or output error
      URISyntaxException - on URI syntax error
    • getChangeSetLink

      @CheckForNull public URL getChangeSetLink(String commitId) throws IOException
      Determines the link to the given change set ID (SHA).
      Parameters:
      commitId - commit identifier, usually a SHA-1 hash
      Returns:
      the URL to the change set or null if this repository browser doesn't have any meaningful URL for a change set
      Throws:
      IOException
    • getNormalizeUrl

      protected boolean getNormalizeUrl()
      Determines whether a URL should be normalized Overridden in the rare case where it shouldn't
      Returns:
      True if the URL should be normalized
    • getIndexOfPath

      protected int getIndexOfPath(GitChangeSet.Path path) throws IOException
      Calculate the index of the given path in a sorted list of affected files
      Parameters:
      path - affected file path
      Returns:
      The index in the lexicographical sorted filelist
      Throws:
      IOException - on input or output error
    • encodeURL

      public static URL encodeURL(URL url) throws IOException
      Throws:
      IOException
    • initialChecksAndReturnOk

      protected static boolean initialChecksAndReturnOk(Item project, String cleanUrl)
    • validateUrl

      protected static boolean validateUrl(String url) throws URISyntaxException
      Throws:
      URISyntaxException