com.atlassian.bamboo.utils
Class BambooUrl

java.lang.Object
  extended by com.atlassian.bamboo.utils.BambooUrl

public class BambooUrl
extends java.lang.Object

Encapsulates creation of redirect URLs


Constructor Summary
BambooUrl(AdministrationConfiguration administrationConfiguration)
           
 
Method Summary
static java.lang.String getCurrentPathAndQuery()
           
 java.lang.String withBaseUrlFromConfiguration()
          This URL should be used for storage or when a user other than the current one will use it.
 java.lang.String withBaseUrlFromConfiguration(java.lang.String path)
          This URL should be used for storage or when a user other than the current one will use it.
 java.lang.String withBaseUrlFromRequest()
          This URL should be used when redirecting to Bamboo instance from external applications within the same user session.
 java.lang.String withBaseUrlFromRequest(java.lang.String path)
          This URL should be used when redirecting to Bamboo instance from external applications within the same user session.
 java.lang.String withRelativeUrl()
          This URL should be used when redirecting internally within Bamboo instance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BambooUrl

public BambooUrl(AdministrationConfiguration administrationConfiguration)
Method Detail

withBaseUrlFromConfiguration

public java.lang.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 java.lang.String withBaseUrlFromConfiguration(@NotNull
                                                             java.lang.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 java.lang.String withRelativeUrl()
This URL should be used when redirecting internally within Bamboo instance

Returns:
path and query from the current Request

withBaseUrlFromRequest

@NotNull
public java.lang.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 java.lang.String withBaseUrlFromRequest(@NotNull
                                                       java.lang.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 java.lang.String getCurrentPathAndQuery()
Returns:
the current path and query from request
Throws:
java.lang.IllegalStateException - if HttpServletRequest is not present


Copyright © 2012 Atlassian. All Rights Reserved.