Code example for URI

Methods: normalizeresolvetoASCIIString

0
  public void setClusterURL(URI u, SharedPreferences prefs) {
    if (u == null) {
      Log.w(LOG_TAG, "Refusing to set cluster URL to null.");
      return; 
    } 
    URI uri = u.normalize();
    if (uri.toASCIIString().endsWith("/")) {
      setAndPersistClusterURL(u, prefs);
      return; 
    } 
    setAndPersistClusterURL(uri.resolve("/"), prefs);
    Log.i(LOG_TAG, "Set cluster URL to " + clusterURL.toASCIIString() + ", given input " + u.toASCIIString());
  } 
 
  public void setClusterURL(String url) throws URISyntaxException {
    this.setClusterURL(new URI(url));
  } 
 
  /** 
   * Used for direct management of related prefs. 
Contextual code suggestions in your IDE  Get Codota for Java