Interface DomainNameFinder
-
- All Known Implementing Classes:
DomainNameFinderImpl
public interface DomainNameFinder
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Boolean
domainMatchesAnyPattern(String s, List<String> wildcardPatterns)
Accepts one or more wildcard patterns and a string; returns true if string matches at least one of the patterns, or false otherwise.List<String>
findDomains(String s)
Find all substrings that may be domain names/URLs and return them as a list.List<String>
findExternalDomains(String s, List<String> wildcardPatterns)
Accepts one or more wildcard patterns and a string; returns a list of found external domains, where external domain is a domain that does NOT match any of supplied patterns.default List<String>
getPatterns(String rawPatterns)
List<String>
getPatterns(String rawPatterns, Boolean includeServerHostname)
Accepts comma-separated list of wildcard patterns and returns a list of pattern strings.
-
-
-
Method Detail
-
getPatterns
List<String> getPatterns(String rawPatterns, Boolean includeServerHostname)
Accepts comma-separated list of wildcard patterns and returns a list of pattern strings. If includeServerUrl property is set to true, will also append server URL to the list.- Parameters:
rawPatterns
- comma-separated list of wildcard patterns.includeServerHostname
- defines whether server hostname should be included.
-
domainMatchesAnyPattern
Boolean domainMatchesAnyPattern(String s, List<String> wildcardPatterns)
Accepts one or more wildcard patterns and a string; returns true if string matches at least one of the patterns, or false otherwise.- Parameters:
s
- a string to be checked.wildcardPatterns
- list of wildcard pattern strings.
-
findDomains
List<String> findDomains(String s)
Find all substrings that may be domain names/URLs and return them as a list.- Parameters:
s
- a string that may be containing domain names or URLs.
-
findExternalDomains
List<String> findExternalDomains(String s, List<String> wildcardPatterns)
Accepts one or more wildcard patterns and a string; returns a list of found external domains, where external domain is a domain that does NOT match any of supplied patterns.- Parameters:
s
- a string to be checked.wildcardPatterns
- list of wildcard pattern strings.
-
-