Class UrlStringUtils
java.lang.Object
org.owasp.dependencycheck.utils.UrlStringUtils
- Author:
- Jeremy Long
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleancontainsUrl(String text) Tests if the text provided contains a URL.Takes a URL, in String format, and adds the important parts of the URL to a list of strings.static booleanTests if the given text is url.
-
Method Details
-
containsUrl
Tests if the text provided contains a URL. This is somewhat limited search in that it only looks for (ftp|http|https)://- Parameters:
text- the text to search- Returns:
- true if the text contains a url, otherwise false
-
isUrl
Tests if the given text is url.- Parameters:
text- the string to test- Returns:
- returns true if the text is a url, otherwise false
-
extractImportantUrlData
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"}- Parameters:
text- a URL- Returns:
- importantParts a list of the important parts of the URL
- Throws:
MalformedURLException- thrown if the URL is malformed
-