private boolean canConnect(final String server){
  boolean success=false;
  try {
    final URL url=new URL(server + "/protocol");
    final BufferedReader reader=new BufferedReader(new InputStreamReader(url.openStream()));
    try {
      Integer.parseInt(reader.readLine());
      success=true;
    }
  finally {
      reader.close();
    }
  }
 catch (  MalformedURLException e) {
    LOGGER.warn(e.toString(),e);
  }
catch (  IOException e) {
    LOGGER.warn(e.toString(),e);
  }
  return success;
}

private boolean canConnect ( final String server ) { boolean success = false ; try { final URL url = new URL ( server + "/protocol" ) ; final BufferedReader reader = new BufferedReader ( new InputStreamReader ( url . openStream ( ) ) ) ; try { Integer . parseInt ( reader . readLine ( ) ) ; success = true ; } finally { reader . close ( ) ; } } catch ( MalformedURLException e ) { LOGGER . warn ( e . toString ( ) , e ) ; } catch ( IOException e ) { LOGGER . warn ( e . toString ( ) , e ) ; } return success ; }
assumption : server won ' t require credentials to access the protocol path .
