Here you can find the source of getURI(String spec)
public static URI getURI(String spec)
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); import java.net.URI; import java.net.URISyntaxException; public class Main { public static URI getURI(String spec) { try {/* ww w. ja v a 2 s . c o m*/ return new URI(spec); } catch (URISyntaxException e) { throw new IllegalArgumentException("Don't know how to convert " + spec + " to URI"); } } }