Here you can find the source of createUri(String uri)
Parameter | Description |
---|---|
uri | The URI in string format |
public static URI createUri(String uri)
//package com.java2s; //License from project: Open Source License import java.net.URI; import java.net.URISyntaxException; public class Main { /** The empty URI **/ public final static URI EMPTYURI = createUri(""); /**//w w w.ja v a2 s. c om * Creates a URI from the specified string without throwing a <tt>URISyntaxException</tt>. * @param uri The URI in string format * @return The URI */ public static URI createUri(String uri) { try { return new URI(uri); } catch (URISyntaxException e) { return EMPTYURI; } } }