Class GitRepositoryBrowser

    • Constructor Detail

      • GitRepositoryBrowser

        @Deprecated
        protected GitRepositoryBrowser()
        Deprecated.
      • GitRepositoryBrowser

        protected GitRepositoryBrowser​(String repourl)
    • Method Detail

      • getRepoUrl

        public final String getRepoUrl()
      • 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
      • initialChecksAndReturnOk

        protected static boolean initialChecksAndReturnOk​(Item project,
                                                          String cleanUrl)