Package hudson.plugins.git.browser
Class GitRepositoryBrowser
- java.lang.Object
-
- hudson.model.AbstractDescribableImpl<RepositoryBrowser<?>>
-
- hudson.scm.RepositoryBrowser<GitChangeSet>
-
- hudson.plugins.git.browser.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:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
GitRepositoryBrowser()
Deprecated.protected
GitRepositoryBrowser(String repourl)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static URL
encodeURL(URL url)
URL
getChangeSetLink(String commitId)
Determines the link to the given change set ID (SHA).abstract URL
getDiffLink(GitChangeSet.Path path)
Determines the link to the diff between the version in the specified revision ofGitChangeSet.Path
to its previous version.abstract URL
getFileLink(GitChangeSet.Path path)
Determines the link to a single file under Git.protected int
getIndexOfPath(GitChangeSet.Path path)
Calculate the index of the given path in a sorted list of affected filesprotected boolean
getNormalizeUrl()
Determines whether a URL should be normalized Overridden in the rare case where it shouldn'tString
getRepoUrl()
URL
getUrl()
protected static boolean
initialChecksAndReturnOk(Item project, String cleanUrl)
protected static boolean
validateUrl(String url)
-
Methods inherited from class hudson.scm.RepositoryBrowser
all, getChangeSetLink, normalizeToEndWithSlash, trimHeadSlash
-
Methods inherited from class hudson.model.AbstractDescribableImpl
getDescriptor
-
-
-
-
Constructor Detail
-
GitRepositoryBrowser
@Deprecated protected GitRepositoryBrowser()
Deprecated.
-
GitRepositoryBrowser
protected GitRepositoryBrowser(String repourl)
-
-
Method Detail
-
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 ofGitChangeSet.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 errorURISyntaxException
- 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
-
-