com.atlassian.confluence.web
Class UrlBuilder

java.lang.Object
  extended by com.atlassian.confluence.web.UrlBuilder

public final class UrlBuilder
extends Object

A builder which can construct URLs by adding parameters. Not thread-safe.

Since:
3.0

Constructor Summary
UrlBuilder(String baseUrl, String encoding)
          Constructs a builder with the given base URL, which should already be URL-encoded.
 
Method Summary
 UrlBuilder add(String name, int value)
          Adds a parameter to the URL.
 UrlBuilder add(String name, long value)
          Adds a parameter to the URL.
 UrlBuilder add(String name, String value)
          Adds a parameter to the 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(String baseUrl,
                  String encoding)
Constructs a builder with the given base URL, which should already be URL-encoded.

Method Detail

add

public UrlBuilder add(String name,
                      String value)
               throws IllegalArgumentException
Adds a parameter to the URL.

Parameters:
name - the name of the parameter
value - the value of the parameter
Throws:
IllegalArgumentException - if either the name or value is null

add

public UrlBuilder add(String name,
                      long value)
               throws IllegalArgumentException
Adds a parameter to the URL.

Throws:
IllegalArgumentException
See Also:
add(String, String)

add

public UrlBuilder add(String name,
                      int value)
               throws IllegalArgumentException
Adds a parameter to the URL.

Throws:
IllegalArgumentException
See Also:
add(String, String)

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2003-2010 Atlassian. All Rights Reserved.