com.pingidentity.opentoken.util
Class UrlHelper

java.lang.Object
  extended by com.pingidentity.opentoken.util.UrlHelper

public class UrlHelper
extends Object

The UrlHelper class allows the addition of 1 or more parameter(s) for a given URL. The Uniform Resource Locator or Universal Resource Locator (URL) is a specific character string that constitutes a reference to an Internet resource. eg: http://server/path/document

The parameter consists of name value pairs, separated by ampersand "&". eg: name1=value1&name2=value2

The fully constructed URL looks like this: http://server/path/document?name1=value1&name2=value2


Constructor Summary
UrlHelper(String url)
          Create UrlHelper class with a given URL.
 
Method Summary
 void addParameter(String name, String value)
          Adds or appends a parameter to the URL.
 String toString()
          Prints a String representation of the URL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UrlHelper

public UrlHelper(String url)
          throws MalformedURLException
Create UrlHelper class with a given URL.

Parameters:
url - A valid URL eg "http://hostname/"
Throws:
MalformedURLException - throws exception if the URL passed is not valid.
Method Detail

addParameter

public void addParameter(String name,
                         String value)
Adds or appends a parameter to the URL.

Parameters:
name - the name of the parameter
value - the value of the parameter

toString

public String toString()
Prints a String representation of the URL.

Overrides:
toString in class Object


Copyright © 2012. All Rights Reserved.