private Response requestHttpGetFromRegistry(String url) throws RegistryException {
  try {
    Response resp=http.get(url);
    if (resp != null && resp.content != null) {
      return resp;
    }
 else {
      throw new RegistryException(TYPE.BAD_RESPONSE,"Response content is null");
    }
  }
 catch (  ClassCastException e) {
    throw new RegistryException(TYPE.BAD_RESPONSE,e);
  }
catch (  ConnectException e) {
    throw new RegistryException(TYPE.PROXY,e);
  }
catch (  UnknownHostException e) {
    try {
      http.get("http://www.google.com");
    }
 catch (    Exception e1) {
      throw new RegistryException(TYPE.NO_INTERNET,e1);
    }
    throw new RegistryException(TYPE.SITE_DOWN,e);
  }
catch (  IOException e) {
    throw new RegistryException(TYPE.IO_ERROR,e);
  }
catch (  URISyntaxException e) {
    throw new RegistryException(TYPE.BAD_REQUEST,"Please check the request URL: " + ((url != null) ? url : "empty URL used!"));
  }
}

private Response requestHttpGetFromRegistry ( String url ) throws RegistryException { try { Response resp = http . get ( url ) ; if ( resp != null && resp . content != null ) { return resp ; } else { throw new RegistryException ( TYPE . BAD_RESPONSE , "Response content is null" ) ; } } catch ( ClassCastException e ) { throw new RegistryException ( TYPE . BAD_RESPONSE , e ) ; } catch ( ConnectException e ) { throw new RegistryException ( TYPE . PROXY , e ) ; } catch ( UnknownHostException e ) { try { http . get ( "http://www.google.com" ) ; } catch ( Exception e1 ) { throw new RegistryException ( TYPE . NO_INTERNET , e1 ) ; } throw new RegistryException ( TYPE . SITE_DOWN , e ) ; } catch ( IOException e ) { throw new RegistryException ( TYPE . IO_ERROR , e ) ; } catch ( URISyntaxException e ) { throw new RegistryException ( TYPE . BAD_REQUEST , "Please check the request URL: " + ( ( url != null ) ? url : "empty URL used!" ) ) ; } }
executes an http get request against the gbif registry . if the content is not null , the response is returned . otherwise , if the content was null , or an exception occurred , it throws the appropriate type of registryexception .
