public interface

BaseUrl

com.atlassian.jira.util.BaseUrl
Known Indirect Subclasses

Summary

Public Methods
URI getBaseUri()
@Nonnull String getBaseUrl()
@Nonnull String getCanonicalBaseUrl()
@Nullable <I, O> O runWithStaticBaseUrl(I input, Function<I, O> runnable)
Run the passed function in an environment where JIRA's configured baseURL is always used.

Public Methods

public URI getBaseUri ()

Returns
  • The absolute base URI for this instance. It will contain trailing "/" character (eg. "http://example.com/jira/") as opposed to getCanonicalBaseUrl()

@Nonnull public String getBaseUrl ()

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.

@Nonnull public String getCanonicalBaseUrl ()

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.

@Nullable public O runWithStaticBaseUrl (I input, Function<I, O> runnable)

Run the passed function in an environment where JIRA's configured baseURL is always used. This basically makes the passed function ignore any smart baseURL that can be generated from the request associated with the calling thread.

Parameters
input input to pass to the function.
runnable the function to execute.
Returns
  • the result of the function.