private void handleSitemap(ParseState state,RobotToken token){
  String sitemap=token.getData();
  try {
    URL sitemap_url=new URL(new URL(state.getUrl()),sitemap);
    String hostname=sitemap_url.getHost();
    if ((hostname != null) && (hostname.length() > 0)) {
      state.addSitemap(sitemap_url.toExternalForm());
    }
  }
 catch (  Exception e) {
    reportWarning("Invalid URL with sitemap directive: " + sitemap,state.getUrl());
  }
}

private void handleSitemap ( ParseState state , RobotToken token ) { String sitemap = token . getData ( ) ; try { URL sitemap_url = new URL ( new URL ( state . getUrl ( ) ) , sitemap ) ; String hostname = sitemap_url . getHost ( ) ; if ( ( hostname != null ) && ( hostname . length ( ) > 0 ) ) { state . addSitemap ( sitemap_url . toExternalForm ( ) ) ; } } catch ( Exception e ) { reportWarning ( "Invalid URL with sitemap directive: " + sitemap , state . getUrl ( ) ) ; } }
handle the sitemap : directive
