public static boolean isValid ( String s ) { try { new URI ( UriEncoder . encode ( s ) ) ; } catch ( URISyntaxException e ) { return false ; } return true ; }
Tests whether a string is a valid URI reference .