Class WebLinks


  • public class WebLinks
    extends RelativeWebLinks
    This helper creates absolute links to different TeamCity pages.
    • Constructor Detail

      • WebLinks

        public WebLinks​(@NotNull
                        RootUrlHolder urlHolder)
        Creates new links helper.
        Parameters:
        urlHolder - root URL provider.
    • Method Detail

      • setUrlHolder

        public void setUrlHolder​(@NotNull
                                 RootUrlHolder holder)
        Changes server root url provider.
        Parameters:
        holder - new provider.
      • getRootUrl

        @Deprecated
        @NotNull
        public String getRootUrl()
        Deprecated.
        use getRootUrlByProjectExternalId or getRootUrlByProjectInternalId instead.
        Returns:
        root server URL
      • getRootUrlByProjectExternalId

        @NotNull
        public String getRootUrlByProjectExternalId​(@Nullable
                                                    String extProjectId)
        Returns root server URL by project external id.
      • getRootUrlByProjectInternalId

        @NotNull
        public String getRootUrlByProjectInternalId​(@Nullable
                                                    String internalId)
        Returns root server URL by project internal id.
      • getHelp

        @NotNull
        public String getHelp​(@NotNull
                              String pageName)
        Parameters:
        pageName - specified page name
        Returns:
        URL of the specified page help
      • getHelp

        @NotNull
        public String getHelp​(@NotNull
                              String pageName,
                              @Nullable
                              String anchor)
        Parameters:
        pageName - specified page name and anchor
        anchor - specified anchor
        Returns:
        URL of the specified page help
      • cutOffBaseUrl

        @Deprecated
        @NotNull
        public String cutOffBaseUrl​(@NotNull
                                    String url)
        Deprecated.
        use RelativeWebLinks instead.
        Cuts the base URL off, when the link path should not include the domain.
        Parameters:
        url - full url
        Returns:
        absolute path without base URL