BrokenEvent nanotests

com.brokenevent.nanotests.url
Class UrlParser

java.lang.Object
  extended by com.brokenevent.nanotests.url.UrlParser

public class UrlParser
extends java.lang.Object

Helper URL parser class to be used in UrlAssert

Author:
BrokenEvent

Constructor Summary
UrlParser(java.lang.String url)
          Initializes the instance of the UrlParser with the URL's parts.
 
Method Summary
 java.lang.String getDomain()
          Gets the domain part of the URL.
 java.lang.String getParam(java.lang.String paramName)
          Gets the param of the URL.
 java.lang.String getProtocol()
          Gets the protocol part of the URL.
 java.lang.String getResource()
          Gets the resource part of the URL.
 boolean haveParam(java.lang.String paramName)
          Checks the param existance in the URL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UrlParser

public UrlParser(java.lang.String url)
          throws java.io.UnsupportedEncodingException
Initializes the instance of the UrlParser with the URL's parts.

Parameters:
url - URL value to parse
Throws:
java.io.UnsupportedEncodingException - may be thrown by URLDecoder when param decoding is failed
Method Detail

getProtocol

public java.lang.String getProtocol()
Gets the protocol part of the URL.

Returns:
protocol part of the URL

getDomain

public java.lang.String getDomain()
Gets the domain part of the URL.

Returns:
domain part of the URL

getResource

public java.lang.String getResource()
Gets the resource part of the URL.

Returns:
resource part of the URL

getParam

public java.lang.String getParam(java.lang.String paramName)
Gets the param of the URL.

Parameters:
paramName - param name to get
Returns:
param value or null if doesn't exist

haveParam

public boolean haveParam(java.lang.String paramName)
Checks the param existance in the URL.

Parameters:
paramName - param name to check
Returns:
True if param exists and fails if it isn't

BrokenEvent nanotests