core/src/main/java/com/digitalpebble/stormcrawler/util/URLUtil.java
public static String[] getHostSegments(URL url) {
        String host = url.getHost();
        // return whole hostname, if it is an ipv4
        // TODO : handle ipv6
        if (IP_PATTERN.matcher(host).matches())
            return new String[] { host };
        return host.split("\\.");
    }
public static String[] getHostSegments(URL url) {
        String host = url.getHost();
        // return whole hostname, if it is an ipv4
        // TODO : handle ipv6
        if (IP_PATTERN.matcher(host).matches())
            return new String[] { host };
        return host.split("\\.");
    }
public static String [ ] getHostSegments ( URL url ) { String host = url . getHost ( ) ; // return whole hostname, if it is an ipv4 // TODO : handle ipv6 if ( IP_PATTERN . matcher ( host ) . matches ( ) ) return new String [ ] { host } ; return host . split ( "\\." ) ; }
Partitions of the hostname of the url by "."
Partitions of the hostname of the url by .