Class DomainNameFinderImpl

    • Constructor Detail

      • DomainNameFinderImpl

        public DomainNameFinderImpl​(ServerRootUrlHolder serverRootUrlHolder)
    • Method Detail

      • getPatterns

        public List<String> getPatterns​(String rawPatterns,
                                        Boolean includeServerHostname)
        Description copied from interface: DomainNameFinder
        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.
        Specified by:
        getPatterns in interface DomainNameFinder
        Parameters:
        rawPatterns - comma-separated list of wildcard patterns.
        includeServerHostname - defines whether server hostname should be included.
      • domainMatchesAnyPattern

        public Boolean domainMatchesAnyPattern​(String s,
                                               List<String> wildcardPatterns)
        Description copied from interface: DomainNameFinder
        Accepts one or more wildcard patterns and a string; returns true if string matches at least one of the patterns, or false otherwise.
        Specified by:
        domainMatchesAnyPattern in interface DomainNameFinder
        Parameters:
        s - a string to be checked.
        wildcardPatterns - list of wildcard pattern strings.
      • findDomains

        public List<String> findDomains​(String s)
        Description copied from interface: DomainNameFinder
        Find all substrings that may be domain names/URLs and return them as a list.
        Specified by:
        findDomains in interface DomainNameFinder
        Parameters:
        s - a string that may be containing domain names or URLs.
      • findExternalDomains

        public List<String> findExternalDomains​(String s,
                                                List<String> wildcardPatterns)
        Description copied from interface: DomainNameFinder
        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.
        Specified by:
        findExternalDomains in interface DomainNameFinder
        Parameters:
        s - a string to be checked.
        wildcardPatterns - list of wildcard pattern strings.