Here you can find the source of getURI(File file)
public static URI getURI(File file)
//package com.java2s; //License from project: Open Source License import java.io.File; import java.net.URI; import java.net.URISyntaxException; public class Main { /** Return URI for file. Replacement for File.toURI() with defined (empty) authority. */ public static URI getURI(File file) { try {//from ww w. j a va2 s.com return new URI("file", "", file.toURI().getPath(), null, null); } catch (URISyntaxException e) { return null; } } }