Here you can find the source of isURI(String plainString)
public static boolean isURI(String plainString)
//package com.java2s; //License from project: Open Source License import java.net.MalformedURLException; import java.net.URI; import java.net.URISyntaxException; import java.net.URL; public class Main { public static boolean isURI(String plainString) { try {/*from www. ja v a2 s . c o m*/ URL url = new URL(plainString); URI uri = new URI(url.getProtocol(), url.getUserInfo(), url.getHost(), url.getPort(), url.getPath(), url.getQuery(), url.getRef()); return true; } catch (URISyntaxException | MalformedURLException e) { return false; } } }