public static String addProtocolToUrl(String url){
  if (!url.startsWith(HTTP_PROTOCOL_PREFIX) && !url.startsWith(HTTPS_PROTOCOL_PREFIX) && !url.startsWith(FILE_PROTOCOL_PREFIX)) {
    if (url.startsWith(FILE_PREFIX)) {
      url=FILE_PROTOCOL_PREFIX + url;
    }
 else {
      url=HTTP_PROTOCOL_PREFIX + url;
    }
  }
  return url;
}

public static String addProtocolToUrl ( String url ) { if ( ! url . startsWith ( HTTP_PROTOCOL_PREFIX ) && ! url . startsWith ( HTTPS_PROTOCOL_PREFIX ) && ! url . startsWith ( FILE_PROTOCOL_PREFIX ) ) { if ( url . startsWith ( FILE_PREFIX ) ) { url = FILE_PROTOCOL_PREFIX + url ; } else { url = HTTP_PROTOCOL_PREFIX + url ; } } return url ; }
this method add the protocol to the url if the protocol is missing
