Here you can find the source of createUri(File file)
public static URI createUri(File file)
//package com.java2s; //License from project: Apache License import java.io.File; import java.net.URI; public class Main { public static URI createUri(File file) { return file.toURI(); // TODO handle special cases where the file path contains already URI like prefix }//from w ww.j a v a 2 s . c om }