Here you can find the source of toFile(URI uri)
Parameter | Description |
---|---|
uri | the URI to create the file for. |
public static File toFile(URI uri)
//package com.java2s; import java.io.File; import java.net.URI; public class Main { /**// ww w. ja va 2s . c o m * Creates a File from a URI, the URI can be relative or absolute, this method returns only a file * for the Scheme Specific Part. * * @param uri the URI to create the file for. * @return a new file. */ public static File toFile(URI uri) { // if (uri.getScheme() == null) { // try { // uri = new URI("file", uri.getSchemeSpecificPart(), null); // } catch (URISyntaxException e) { // // should never happen // Logger.getLogger(URIUtils.class).fatal(uri, e); // } // } return new File((File) null, uri.getSchemeSpecificPart()); } }