Here you can find the source of getURI(String path)
public static URI getURI(String path)
//package com.java2s; //License from project: Apache License import java.io.*; import java.net.URI; public class Main { public static URI getURI(String path) { if (path.contains(":/")) { // Seems like return URI.create(path); } else {// w ww . j a v a 2 s .c om return new File(path).toURI(); } } }