Here you can find the source of isValidUri(String uriCandidate)
public static boolean isValidUri(String uriCandidate)
//package com.java2s; //License from project: Apache License import java.net.URI; import java.net.URISyntaxException; public class Main { public static boolean isValidUri(String uriCandidate) { try {/*w w w . j a v a2s. c o m*/ new URI(uriCandidate); } catch (URISyntaxException e) { return false; } return true; } }