Package com.wowza.util
Class URLUtils
Object
com.wowza.util.URLUtils
Class to deal with URLs
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringappendParamsToUrl(String url, String params) Convenience call to add parameters to a url.static StringdecodeValue(String val) Wrapper for URLDecoder.decode(val, "UTF-8");static StringencodeValue(String val) Wrapper for URLEncoder.encode(val, "UTF-8");static StringgetParamValue(Map params, String key) Helper funtion to get single value from multiple value parameter Mapstatic MapparseQueryStr(String queryString, boolean doDecode) Parse query string part of url into Map of Lists (to support multiple values) of query parametersstatic StringpathToFileURL(String basePath) Convert a path to a url (file://[path])static StringCreate a MD5 message digest hash of a url
-
Constructor Details
-
URLUtils
public URLUtils()
-
-
Method Details
-
pathToFileURL
Convert a path to a url (file://[path])- Parameters:
basePath- path- Returns:
- file url
-
urlToId
Create a MD5 message digest hash of a url- Parameters:
url- url to hash- Returns:
- hashed url
-
appendParamsToUrl
Convenience call to add parameters to a url. If already has ? add &.- Parameters:
url- input urlparams- parameters in the form param1=val1¶m2=val2- Returns:
- appended url
-
encodeValue
Wrapper for URLEncoder.encode(val, "UTF-8");- Parameters:
val- value to encode- Returns:
- encoded value
-
decodeValue
Wrapper for URLDecoder.decode(val, "UTF-8");- Parameters:
val- value to decode- Returns:
- decoded value
-
parseQueryStr
Parse query string part of url into Map of Lists (to support multiple values) of query parameters- Parameters:
queryString- query stringdoDecode- true to use URLDecoder.decode() to decode parameters- Returns:
- Map of Lists
-
getParamValue
Helper funtion to get single value from multiple value parameter Map- Parameters:
params- params Mapkey- key string- Returns:
- first value
-