# PaidLevelDomain (Crawler-commons 0.9 API)
Date: 2017-10-27

crawlercommons.domains

## Class PaidLevelDomain

- java.lang.Object
- - crawlercommons.domains.PaidLevelDomain

    public class PaidLevelDomain
    extends Object

Routines to extract the PLD (paid-level domain, as per the IRLbot paper) from a hostname or URL.

### Constructor Summary

Constructors
Constructor and Description
`PaidLevelDomain()`

### Method Summary

All Methods Static Methods Concrete Methods
`static String` `getPLD(String hostname)` Extract the PLD (paid-level domain) from the hostname.
`static String` `getPLD(URL url)` Extract the PLD (paid-level domain) from the URL.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### 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.domain.com.it
Returns:
  - PLD, e.g. domain.com.it

#### getPLD

    public static String getPLD(URL url)

Extract the PLD (paid-level domain) from the URL.

Parameters:
  `url` - - Valid URL, e.g. http://www.domain.com.it
Returns:
  - PLD e.g. domain.com.it