Class PaidLevelDomain


  • public class PaidLevelDomain
    extends Object
    Routines to extract the PLD (paid-level domain, as per the IRLbot paper) from a hostname or URL. This class uses the EffectiveTldFinder based on the public suffix list.
    • Constructor Detail

      • PaidLevelDomain

        public PaidLevelDomain()
    • Method Detail

      • getPLD

        public static String getPLD​(String hostname)
        Extract the PLD (paid-level domain) from the hostname. If the format isn't recognized, the original hostname is returned.
        Parameters:
        hostname - hostname from URL, e.g. www.example.co.uk
        Returns:
        PLD, e.g. example.co.uk
      • getPLD

        public static String getPLD​(URL url)
        Extract the PLD (paid-level domain) from the URL.
        Parameters:
        url - valid URL, e.g. https://www.example.co.uk/
        Returns:
        PLD, e.g. example.co.uk