code: public String toUriString(final java.net.URI uri) {
      return this.toUriString(URI.createURI(uri.normalize().toString()));
    }
docs: converts a java.net.URI into a string representation with empty authority, if absent and has file scheme.