@ThreadSafe public final class UrlStringUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
containsUrl(String text)
Tests if the text provided contains a URL.
|
static List<String> |
extractImportantUrlData(String text)
Takes a URL, in String format, and adds the important parts of the URL to
a list of strings.
|
static boolean |
isUrl(String text)
Tests if the given text is url.
|
public static boolean containsUrl(String text)
text - the text to searchpublic static boolean isUrl(String text)
text - the string to testpublic static List<String> extractImportantUrlData(String text) throws MalformedURLException
Takes a URL, in String format, and adds the important parts of the URL to a list of strings.
Example, given the following input:
"https://www.somedomain.com/path1/path2/file.php?id=439"
The function would return:
{"some.domain", "path1", "path2", "file"}text - a URLMalformedURLException - thrown if the URL is malformedCopyright © 2012–2020 OWASP. All rights reserved.