Package com.shaiksphere.mindsmine.jems
Class URLHelper
- java.lang.Object
-
- com.shaiksphere.mindsmine.jems.URLHelper
-
-
Method Summary
Modifier and Type Method Description static String
appendQuery(String url, String param, Object value)
Appends content to the query string of a URL, handling logic for whether to place a question mark or ampersand.static boolean
isValidURL(String url)
Returnstrue
if the passed string is a valid URL,false
otherwise.
-
-
-
Method Detail
-
isValidURL
public static boolean isValidURL(String url)
Returnstrue
if the passed string is a valid URL,false
otherwise.
Example Usage:URLHelper.isValidURL("http://userid@example.com") // true URLHelper.isValidURL("www.example.com/main.html") // false
- Parameters:
url
- to check- Returns:
- if the string is a valid URL
- Since:
- 3.5.0
-
appendQuery
public static String appendQuery(String url, String param, Object value)
Appends content to the query string of a URL, handling logic for whether to place a question mark or ampersand.- Parameters:
url
- The URL to append to.param
- The parameter key to append to the URL.value
- The parameter value to append to the URL.- Returns:
- The resulting URL
- Throws:
IllegalArgumentException
- for Invalid URL or empty arguments- Since:
- 3.5.0
-
-