Package com.atlassian.bamboo.util
Class UrlBuilder
java.lang.Object
com.atlassian.bamboo.util.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
-
Method Summary
Modifier and TypeMethodDescriptionaddParameter
(String name, Number value) addParameter
(String name, String value) addParameters
(Map<String, Object> newParams) Add parameters from a mapgetParameter
(String name) Returns the first item in the params listremoveParameter
(String name) setParameter
(String name, String value) Add a single parametersetUrlBase
(String base) setUrlBase
(URL url) toString()
-
Constructor Details
-
UrlBuilder
public UrlBuilder()
-
-
Method Details