Here you can find the source of toURI(String sUri)
public static URI toURI(String sUri)
//package com.java2s; //License from project: Apache License import java.net.URI; import java.net.URISyntaxException; public class Main { public static URI toURI(String sUri) { try {//from ww w . j ava 2s. c o m return new URI(sUri); } catch (URISyntaxException e) { return null; } } }