Package com.atlassian.bamboo.utils
Class BambooUrl
- java.lang.Object
-
- com.atlassian.bamboo.utils.BambooUrl
-
public class BambooUrl extends Object
Encapsulates creation of redirect URLs.
-
-
Constructor Summary
Constructors Constructor Description BambooUrl(AdministrationConfigurationAccessor administrationConfigurationAccessor)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getBaseUrl(com.atlassian.sal.api.UrlMode urlMode)
static @NotNull String
getCurrentPathAndQuery()
String
rootContext()
String
withBaseUrlFromConfiguration()
This URL should be used for storage or when a user other than the current one will use it.@NotNull String
withBaseUrlFromConfiguration(@NotNull String path)
This URL should be used for storage or when a user other than the current one will use it.@NotNull String
withBaseUrlFromRequest()
This URL should be used when redirecting to Bamboo instance from external applications within the same user session.@NotNull String
withBaseUrlFromRequest(@NotNull String path)
This URL should be used when redirecting to Bamboo instance from external applications within the same user session.@NotNull String
withRelativeUrl()
This URL should be used when redirecting internally within Bamboo instance
-
-
-
Constructor Detail
-
BambooUrl
public BambooUrl(AdministrationConfigurationAccessor administrationConfigurationAccessor)
-
-
Method Detail
-
withBaseUrlFromConfiguration
public String withBaseUrlFromConfiguration()
This URL should be used for storage or when a user other than the current one will use it.- Returns:
- current absolute URL with base taken from configuration with the current path and query appended to it.
-
withBaseUrlFromConfiguration
@NotNull public @NotNull String withBaseUrlFromConfiguration(@NotNull @NotNull String path)
This URL should be used for storage or when a user other than the current one will use it.- Returns:
- current absolute URL with base taken from configuration with the provided path appended to it.
-
withRelativeUrl
@NotNull public @NotNull String withRelativeUrl()
This URL should be used when redirecting internally within Bamboo instance- Returns:
- path and query from the current Request
-
withBaseUrlFromRequest
@NotNull public @NotNull String withBaseUrlFromRequest()
This URL should be used when redirecting to Bamboo instance from external applications within the same user session. Example: login dance.- Returns:
- base url, path and query from the current Request
-
withBaseUrlFromRequest
@NotNull public @NotNull String withBaseUrlFromRequest(@NotNull @NotNull String path)
This URL should be used when redirecting to Bamboo instance from external applications within the same user session. Example: login dance.- Returns:
- base urlfrom the current Request with supplied path appended to it
-
getCurrentPathAndQuery
@NotNull public static @NotNull String getCurrentPathAndQuery()
- Returns:
- the current path and query from request
- Throws:
IllegalStateException
- if HttpServletRequest is not present
-
rootContext
public String rootContext()
-
getBaseUrl
public String getBaseUrl(com.atlassian.sal.api.UrlMode urlMode)
-
-