Here you can find the source of parseURI(String target)
public static URI parseURI(String target)
//package com.java2s; //License from project: Apache License import java.net.URI; import java.net.URISyntaxException; public class Main { public static URI parseURI(String target) { target = parseString(target);// w w w.j a v a 2s .c o m if (target == null) { return null; } URI uri; try { uri = new URI(target); } catch (URISyntaxException e) { uri = null; } return uri; } /** * Pre-process the String object. If object is null, return null; otherwise * remove heading and tailing white space. */ public static String parseString(String target) { if (target == null) { return null; } else { return target.trim(); } } }