com.wowza.util
Class URLUtils

Object
  extended by com.wowza.util.URLUtils

public final class URLUtils
extends Object

Class to deal with URLs


Constructor Summary
URLUtils()
           
 
Method Summary
static String appendParamsToUrl(String url, String params)
          Convenience call to add parameters to a url.
static String decodeValue(String val)
          Wrapper for URLDecoder.decode(val, "UTF-8");
static String encodeValue(String val)
          Wrapper for URLEncoder.encode(val, "UTF-8");
static String getParamValue(java.util.Map params, String key)
          Helper funtion to get single value from multiple value parameter Map
static java.util.Map parseQueryStr(String queryString, boolean doDecode)
          Parse query string part of url into Map of Lists (to support multiple values) of query parameters
static String pathToFileURL(String basePath)
          Convert a path to a url (file://[path])
static String urlToId(java.net.URL url)
          Create a MD5 message digest hash of a url
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URLUtils

public URLUtils()
Method Detail

appendParamsToUrl

public static String appendParamsToUrl(String url,
                                       String params)
Convenience call to add parameters to a url. If already has ? add &.

Parameters:
url - input url
params - parameters in the form param1=val1¶m2=val2
Returns:
appended url

decodeValue

public static String decodeValue(String val)
Wrapper for URLDecoder.decode(val, "UTF-8");

Parameters:
val - value to decode
Returns:
decoded value

encodeValue

public static String encodeValue(String val)
Wrapper for URLEncoder.encode(val, "UTF-8");

Parameters:
val - value to encode
Returns:
encoded value

getParamValue

public static String getParamValue(java.util.Map params,
                                   String key)
Helper funtion to get single value from multiple value parameter Map

Parameters:
params - params Map
key - key string
Returns:
first value

parseQueryStr

public static java.util.Map parseQueryStr(String queryString,
                                          boolean doDecode)
Parse query string part of url into Map of Lists (to support multiple values) of query parameters

Parameters:
queryString - query string
doDecode - true to use URLDecoder.decode() to decode parameters
Returns:
Map of Lists

pathToFileURL

public static String pathToFileURL(String basePath)
Convert a path to a url (file://[path])

Parameters:
basePath - path
Returns:
file url

urlToId

public static String urlToId(java.net.URL url)
Create a MD5 message digest hash of a url

Parameters:
url - url to hash
Returns:
hashed url