|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.bamboo.util.UrlBuilder
public class UrlBuilder
From http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6306820
Given a URL and a set of parameters, provide abilites to add and remove parameters (either directly, from a Map, or from a Bean), and finally reconstruct the proper URL. For example: UrlBuilder builder = new UrlBuilder() .setUrl( strUrl )) .addParameters( p_request.getParameterMap() );
.removeParameter( "id" ) .addParameter( "session", strSession );
Note that this class currently does not support URL rewriting of cookie strings (though it should).
Constructor Summary | |
---|---|
UrlBuilder()
|
Method Summary | |
---|---|
UrlBuilder |
addParameter(java.lang.String name,
java.lang.String value)
|
UrlBuilder |
addParameters(java.util.Map newParams)
Add parameters from a map |
UrlBuilder |
addPath(java.lang.String contextPath)
|
java.lang.String |
getParameter(java.lang.String name)
Returns the first item in the params list |
UrlBuilder |
removeParameter(java.lang.String name)
|
UrlBuilder |
setParameter(java.lang.String name,
java.lang.String value)
Add a single parameter |
UrlBuilder |
setUrl(java.lang.String url)
|
UrlBuilder |
setUrlBase(java.lang.String base)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public UrlBuilder()
Method Detail |
---|
public UrlBuilder setUrlBase(java.lang.String base)
public UrlBuilder addPath(java.lang.String contextPath)
public UrlBuilder setUrl(java.lang.String url)
public UrlBuilder addParameters(java.util.Map newParams)
public UrlBuilder setParameter(java.lang.String name, java.lang.String value)
public UrlBuilder addParameter(java.lang.String name, java.lang.String value)
public UrlBuilder removeParameter(java.lang.String name)
public java.lang.String getParameter(java.lang.String name)
name
-
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |