Package com.wowza.util
Class URLUtils
Object
com.wowza.util.URLUtils
Class to deal with URLs
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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
(Map params, String key) Helper funtion to get single value from multiple value parameter Mapstatic Map
parseQueryStr
(String queryString, boolean doDecode) Parse query string part of url into Map of Lists (to support multiple values) of query parametersstatic String
pathToFileURL
(String basePath) Convert a path to a url (file://[path])static String
Create 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
-