public String getReferencedHost ( ) throws URIException { String referencedHost = this . getHost ( ) ; if ( referencedHost == null && this . getScheme ( ) . equals ( "dns" ) ) { // extract target domain of DNS lookup String possibleHost = this . getCurrentHierPath ( ) ; if ( possibleHost != null && possibleHost . matches ( "[-_\\w\\.:]+" ) ) { referencedHost = possibleHost ; } } return referencedHost ; }
Return the referenced host in the UURI if any also extracting the host of a DNS - lookup URI where necessary .