Package com.atlassian.jira.util
Class MockBaseUrl
java.lang.Object
com.atlassian.jira.util.MockBaseUrl
- All Implemented Interfaces:
BaseUrl
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionresolveAddress(String relative) Resolve the given relative path against the base URI.<I,O> O runWithStaticBaseUrl(I input, com.google.common.base.Function<I, O> runnable) Run the passed function in an environment where JIRA's configuredbaseURLis always used.
-
Constructor Details
-
MockBaseUrl
-
-
Method Details
-
getBaseUrl
- Specified by:
getBaseUrlin interfaceBaseUrl- Returns:
- The base URL for this instance, also known as the context path. If running in the context of a web request, this will return a url relative to the server root (ie "/jira/"). If running via email, it will return an absolute URL (eg. "http://example.com/jira"). In both cases URL does not contain trailing "/" character.
-
getCanonicalBaseUrl
- Specified by:
getCanonicalBaseUrlin interfaceBaseUrl- Returns:
- The canonical base URL for this instance. It will return an absolute URL (eg. "http://example.com/jira"). This URL does not contain trailing "/" character.
-
getBaseUri
- Specified by:
getBaseUriin interfaceBaseUrl- Returns:
- The absolute base URI for this instance. It will contain trailing "/" character (eg. "http://example.com/jira/") as opposed to
BaseUrl.getCanonicalBaseUrl()
-
resolveAddress
Description copied from interface:BaseUrlResolve the given relative path against the base URI.- Specified by:
resolveAddressin interfaceBaseUrl- Parameters:
relative- the path to be resolved- Returns:
- absolute URI
-
runWithStaticBaseUrl
@Nullable public <I,O> O runWithStaticBaseUrl(@Nullable I input, @Nonnull com.google.common.base.Function<I, O> runnable) Description copied from interface:BaseUrlRun the passed function in an environment where JIRA's configuredbaseURLis always used. This basically makes the passed function ignore any smartbaseURLthat can be generated from the request associated with the calling thread.- Specified by:
runWithStaticBaseUrlin interfaceBaseUrl- Parameters:
input- input to pass to the function.runnable- the function to execute.- Returns:
- the result of the function.
-