public boolean exists(@NotNull final URL url){
  requireNonNull(url,"URL parameter cannot be null");
  try {
    final URLConnection urlConnection=url.openConnection();
    urlConnection.setConnectTimeout(CONNECTION_TIMEOUT);
    if (urlConnection instanceof HttpURLConnection) {
      return exists((HttpURLConnection)urlConnection);
    }
 else {
      urlConnection.connect();
      return true;
    }
  }
 catch (  IOException ioe) {
    LOG.debug(UNABLE_TO_CHECK_MESSAGE,url,ioe);
    return false;
  }
}

public boolean exists ( @ NotNull final URL url ) { requireNonNull ( url , "URL parameter cannot be null" ) ; try { final URLConnection urlConnection = url . openConnection ( ) ; urlConnection . setConnectTimeout ( CONNECTION_TIMEOUT ) ; if ( urlConnection instanceof HttpURLConnection ) { return exists ( ( HttpURLConnection ) urlConnection ) ; } else { urlConnection . connect ( ) ; return true ; } } catch ( IOException ioe ) { LOG . debug ( UNABLE_TO_CHECK_MESSAGE , url , ioe ) ; return false ; } }
check if given url location exists remotely
