Here you can find the source of isWellFormedUriString(final String uriString)
public static boolean isWellFormedUriString(final String uriString)
//package com.java2s; // Licensed under the MIT license. See sibling License.txt file import java.net.URI; import java.net.URISyntaxException; public class Main { public static boolean isWellFormedUriString(final String uriString) { try {//from w ww.j a va 2s . co m new URI(uriString); return true; } catch (final URISyntaxException ignored) { return false; } } }