code: public static String newDomainUrl(final String scheme, final String domainName, final int port,
  		final boolean withServerPort, final boolean withSlashAtTheEnd)
  	{
  		final StringBuilder domainUrl = new StringBuilder();
  		domainUrl.append(scheme);
  		domainUrl.append("://");
  		domainUrl.append(domainName);
  		if (withServerPort)
  		{
  			domainUrl.append(":");
  			domainUrl.append(port);
  		}
  		if (withSlashAtTheEnd)
  		{
  			domainUrl.append("/");
  		}
  		return domainUrl.toString();
  	}
docs: Creates a new domain url from the given parameters.
  
  @param scheme
  the scheme
  @param domainName
  the domain name
  @param port
  the port
  @param withServerPort
  the with server port
  @param withSlashAtTheEnd
  the with slash at the end
  @return the string