public static URI encode(final String url){
  return URI.create(url.replaceAll(" ",SPACE));
}

public static URI encode ( final String url ) { return URI . create ( url . replaceAll ( " " , SPACE ) ) ; }
encodes a given string url into a valid uri if possible method should be updated as required to make sure any valid string url that can be pasted into an address bar will fit into a uri object
