/** * Constructor with string parameter * @param uri String representation of URI * @throws URISyntaxException which signals that URI has syntax error * @throws UnknownServiceException which signals that URI has incorrect scheme */ public URI(String uri) throws URISyntaxException, UnknownServiceException { parse(uri); if (getFQDN() == null || getFQDN().trim().length() == 0) { throw new URISyntaxException(uri, "Host not found"); } if (!getScheme().equals("aaa") && !getScheme().equals("aaas")) { throw new UnknownServiceException(new StringBuilder().append("Unsupported service: ").append(getScheme()).toString()); } }