src/main/java/de/qaware/xff/util/uri/HierarchicalUriComponents.java
/**
	 * Returns a URI String from this {@code UriComponents} instance.
	 */
Returns a URI String from this  UriComponents instance.
Returns a URI String from this UriComponents instance .
@Override
	public String toUriString() {
		StringBuilder uriBuilder = new StringBuilder();
		if (getScheme() != null) {
			uriBuilder.append(getScheme());
			uriBuilder.append(':');
		}
		if (this.userInfo != null || this.host != null) {
			uriBuilder.append("//");
			if (this.userInfo != null) {
				uriBuilder.append(this.userInfo);
				uriBuilder.append('@');
			}
			if (this.host != null) {
				uriBuilder.append(host);
			}
			if (getPort() != -1) {
				uriBuilder.append(':');
				uriBuilder.append(port);
			}
		}
		String lpath = getPath();
		if (StringUtils.isNotBlank(lpath)) {
			if (uriBuilder.length() != 0 && lpath.charAt(0) != PATH_DELIMITER) {
				uriBuilder.append(PATH_DELIMITER);
			}
			uriBuilder.append(lpath);
		}
		String query = getQuery();
		if (query != null) {
			uriBuilder.append('?');
			uriBuilder.append(query);
		}
		if (getFragment() != null) {
			uriBuilder.append('#');
			uriBuilder.append(getFragment());
		}
		return uriBuilder.toString();
	}
@ Override public String toUriString ( ) { StringBuilder uriBuilder = new StringBuilder ( ) ; if ( getScheme ( ) != null ) { uriBuilder . append ( getScheme ( ) ) ; uriBuilder . append ( ':' ) ; } if ( this . userInfo != null || this . host != null ) { uriBuilder . append ( "//" ) ; if ( this . userInfo != null ) { uriBuilder . append ( this . userInfo ) ; uriBuilder . append ( '@' ) ; } if ( this . host != null ) { uriBuilder . append ( host ) ; } if ( getPort ( ) != - 1 ) { uriBuilder . append ( ':' ) ; uriBuilder . append ( port ) ; } } String lpath = getPath ( ) ; if ( StringUtils . isNotBlank ( lpath ) ) { if ( uriBuilder . length ( ) != 0 && lpath . charAt ( 0 ) != PATH_DELIMITER ) { uriBuilder . append ( PATH_DELIMITER ) ; } uriBuilder . append ( lpath ) ; } String query = getQuery ( ) ; if ( query != null ) { uriBuilder . append ( '?' ) ; uriBuilder . append ( query ) ; } if ( getFragment ( ) != null ) { uriBuilder . append ( '#' ) ; uriBuilder . append ( getFragment ( ) ) ; } return uriBuilder . toString ( ) ; }
Returns a URI String from this {@code UriComponents} instance.
Returns a URI String from this { @code UriComponents } instance .