Package com.google.gerrit.server.config
Interface UrlFormatter
- All Known Implementing Classes:
DefaultUrlFormatter
public interface UrlFormatter
Formats URLs to different parts of the Gerrit API and UI.
By default, these gerrit URLs are formed by adding suffixes to the web URL. The interface centralizes these conventions, and also allows introducing different, custom URL schemes.
Unfortunately, Gerrit operates in modes for which there is no canonical URL. This can be in standalone utilities that have no HTTP server (eg. index upgrade commands), in servers that run SSH only, or in a HTTP/SSH server that is accessed over SSH without canonical web URL configured.
-
Method Summary
Modifier and TypeMethodDescriptiongetChangeViewUrl
(Project.NameKey project, Change.Id id) Returns the URL for viewing a change.getCommentsTabView
(Change change) Returns the URL for viewing the comment tab view of a change.Returns a URL pointing to a documentation page, at a given named anchor.getFindingsTabView
(Change change) Returns the URL for viewing the findings tab view of a change.getInlineCommentView
(Change change, String uuid) Returns the URL for viewing a comment in a file for a change.getPluginDocUrl
(String pluginName, String page, String anchor) Returns a URL pointing to a plugin documentation page, at a given named anchor.getRestUrl
(String suffix) Returns a REST API URL for a given suffix (eg.Returns a URL pointing to the settings page.getSettingsUrl
(String section) Returns a URL pointing to a section of the settings page, or the settings page ifsection
is null.The canonical base URL where this Gerrit installation can be reached.
-
Method Details
-
getWebUrl
The canonical base URL where this Gerrit installation can be reached.For the default implementations below to work, it must end in "/".
-
getChangeViewUrl
Returns the URL for viewing a change. -
getCommentsTabView
Returns the URL for viewing the comment tab view of a change. -
getFindingsTabView
Returns the URL for viewing the findings tab view of a change. -
getInlineCommentView
Returns the URL for viewing a comment in a file for a change. -
getSettingsUrl
Returns a URL pointing to the settings page. -
getSettingsUrl
Returns a URL pointing to a section of the settings page, or the settings page ifsection
is null. -
getDocUrl
Returns a URL pointing to a documentation page, at a given named anchor. -
getPluginDocUrl
Returns a URL pointing to a plugin documentation page, at a given named anchor. -
getRestUrl
Returns a REST API URL for a given suffix (eg. "accounts/self/details")
-