Code example for URI

Methods: getHost, getPath, getScheme, toString

0
	 */ 
	private void check_URI(URI uri)  throws InvalidURIException
	{ 
        if (uri == null) throw new InvalidURIException();
		 
		if (!uri.getScheme().equals(schemeText)) throw new InvalidURIException();
		 
		 
		 
		if (!EndpointID.is_able_to_create_URI(uri.toString())) throw new InvalidURIException();
	} 
	 
	 
	/** 
	 * Append the given service tag to the uri in a scheme-specific manner. By 
	 * default, the scheme is not capable of this. 
	 *  
	 * @return true if this scheme is capable of service tags and the tag is a 
	 *         legal one, false otherwise. 
	 * @throws InvalidURIException  
	 */ 
	@Override 
	public URI append_service_tag(URI uri, final String tag) throws InvalidURIException{
		 
		check_URI(uri);
		 
		 
		URI uri_result;
		 
		 
		if (tag.charAt(0) != '/')
		{ 
			uri_result = URI.create(uri.getScheme() + "://" + uri.getHost() + "/" + tag);
		} 
		else 
		{ 
			uri_result = URI.create(uri.getScheme() + "://" + uri.getHost()  + tag);
		} 
		 
		return uri_result;
	} 
 
	/** 
	 * Append wildcard to the uri in a scheme-specific manner. The default 
	 * scheme is not capable of this. 
	 *  
	 * @return true if this scheme is capable of wildcards and the wildcard is 
	 *         successfully appended, else false. 
	 * @throws NamingException  
	 */ 
	@Override 
	public URI append_service_wildcard(URI uri) throws InvalidURIException {
 
		if (uri.toString().equals(NullEIDText))throw new InvalidURIException();
		 
		if (!uri.getPath().equals("")) throw new InvalidURIException();
		 
		check_URI(uri);
		 
		URI result_uri = URI.create(uri.getScheme() + "://" + uri.getHost()  + "/*");
		 
		return result_uri;
	} 
 
	/**