Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.atlassian.bamboo.util
Class UrlBuilder

    java.lang.Object
      com.atlassian.bamboo.util.UrlBuilder

    public class UrlBuilder

extends Object

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(String name, String value)`
`UrlBuilder` | `addParameters(Map newParams)` Add parameters from a map
`String` | `getParameter(String name)` Returns the first item in the params list
`UrlBuilder` | `removeParameter(String name)`
`UrlBuilder` | `setParameter(String name, String value)` Add a single parameter
`UrlBuilder` | `setUrl(String url)`
`String` | `toString()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### UrlBuilder

    public UrlBuilder()

Method Detail

### setUrl

    public UrlBuilder setUrl(String url)

### addParameters

    public UrlBuilder addParameters(Map newParams)

  Add parameters from a map

### setParameter

    public UrlBuilder setParameter(String name,
                                   String value)

  Add a single parameter

### addParameter

    public UrlBuilder addParameter(String name,
                                   String value)

### removeParameter

    public UrlBuilder removeParameter(String name)

### getParameter

    public String getParameter(String name)

  Returns the first item in the params list

  Parameters:
    `name` -
  Returns:

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2006 Atlassian Software Systems. All Rights Reserved.