Java File Class toURI() Method with Examples
The toURI() method returns the URI that corresponds to the supplied URL. This method works similarly to the new URI (this.toString()). This abstract pathname is represented by a file: URI.
public URI toURI()
Returns: It returns an absolute hierarchical URI with the scheme “file,” a path that represents this abstract pathname, and undefined authority, query, and fragment components.
- SecurityException: If you can’t get to a needed system property value